mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 00:52:45 -05:00
Validate byline browseId as non-empty string before channel selection
CodeRabbit finding: empty, null, or non-string browseId values could cause invalid channel selection. Only accept runs with valid non-empty string browseId; retain first-run fallback.
This commit is contained in:
parent
3e4cd122ef
commit
d1b8a6a7d5
@ -27,7 +27,9 @@ module Invidious::Videos::Parser
|
||||
.try &.dig?("runs").try &.as_a
|
||||
|
||||
channel_info = byline_runs.try &.find do |run|
|
||||
run.dig?("navigationEndpoint", "browseEndpoint", "browseId")
|
||||
browse_id = run.dig?("navigationEndpoint", "browseEndpoint", "browseId")
|
||||
text_id = browse_id.try &.as_s?
|
||||
!text_id.nil? && !text_id.empty?
|
||||
end || byline_runs.try &.[0]?
|
||||
|
||||
author = channel_info.try &.dig?("text")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user