diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2021-11-29 14:53:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-29 14:53:27 +0100 |
| commit | 342fc202a7c6f34d57b4dbbd22f5df16781327f2 (patch) | |
| tree | cfc0116b326dda242291c6e788f54e1e081f916f /src | |
| parent | c6e086c6fff9699a32465da0ce5e4784c981e886 (diff) | |
| download | invidious-342fc202a7c6f34d57b4dbbd22f5df16781327f2.tar.gz invidious-342fc202a7c6f34d57b4dbbd22f5df16781327f2.tar.bz2 invidious-342fc202a7c6f34d57b4dbbd22f5df16781327f2.zip | |
Fix #2682
Fix "Missing param name: "q" (KeyError)"
https://github.com/iv-org/invidious/issues/2682
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/comments.cr | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index ffdce000..cd1af862 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -575,7 +575,9 @@ def content_to_comment_html(content) url = "/watch?v=#{url.request_target.lstrip('/')}" elsif url.host.nil? || url.host.not_nil!.ends_with?("youtube.com") if url.path == "/redirect" - url = HTTP::Params.parse(url.query.not_nil!)["q"] + # Sometimes, links can be corrupted (why?) so make sure to fallback + # nicely. See https://github.com/iv-org/invidious/issues/2682 + url = HTTP::Params.parse(url.query.not_nil!)["q"]? || "" else url = url.request_target end |
