summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2023-05-03 00:33:24 +0200
committerSamantaz Fox <coding@samantaz.fr>2023-05-03 00:33:24 +0200
commitc1fb320094783800c2173ece8a3c52491b58f22a (patch)
tree52d1555531bcda918886fac8bcfccfc350b8a519 /src
parent97e3938f5f6741d8645c1bdd37deebc6ddc06151 (diff)
parent28584f22c52b243da740061eeb834e300f36b7c1 (diff)
downloadinvidious-c1fb320094783800c2173ece8a3c52491b58f22a.tar.gz
invidious-c1fb320094783800c2173ece8a3c52491b58f22a.tar.bz2
invidious-c1fb320094783800c2173ece8a3c52491b58f22a.zip
Channels: Fix index out of bounds error (#3737)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/comments.cr2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index fd2be73d..b5815bb4 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -604,7 +604,7 @@ def text_to_parsed_content(text : String) : JSON::Any
currentNode = {"text" => urlMatch[0], "navigationEndpoint" => {"urlEndpoint" => {"url" => urlMatch[0]}}}
currentNodes << (JSON.parse(currentNode.to_json))
# If text remain after match create new simple node with text after match
- afterNode = {"text" => splittedLastNode.size > 0 ? splittedLastNode[1] : ""}
+ afterNode = {"text" => splittedLastNode.size > 1 ? splittedLastNode[1] : ""}
currentNodes << (JSON.parse(afterNode.to_json))
end