summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2022-05-18 23:36:50 +0200
committerSamantaz Fox <coding@samantaz.fr>2022-05-18 23:36:50 +0200
commit137534f90126bd786742f9f90dddd2cffe8f0965 (patch)
treeb76e6d224ee5d8d70e79dd1ab634797459e358c0 /src
parentca27e096f3249533cc7a9b123a8a8378f3312bb7 (diff)
downloadinvidious-137534f90126bd786742f9f90dddd2cffe8f0965.tar.gz
invidious-137534f90126bd786742f9f90dddd2cffe8f0965.tar.bz2
invidious-137534f90126bd786742f9f90dddd2cffe8f0965.zip
Fix for #3096
Diffstat (limited to 'src')
-rw-r--r--src/invidious/comments.cr4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index 1f8de657..1237db5d 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -567,6 +567,10 @@ end
def content_to_comment_html(content, video_id : String? = "")
html_array = content.map do |run|
+ # Sometimes, there is an empty element.
+ # See: https://github.com/iv-org/invidious/issues/3096
+ next if run.as_h.empty?
+
text = HTML.escape(run["text"].as_s)
if run["navigationEndpoint"]?