Skip to content

Invidious is an alternative front-end to YouTube

Fix arg_array on empty

Omar Roth172fc72fa9ba
diff --git a/src/helpers.cr b/src/helpers.cr
index bca3954e..47652163 100644
--- a/src/helpers.cr
+++ b/src/helpers.cr
@@ -428,9 +428,13 @@ def number_with_separator(number)
end
def arg_array(array, start = 1)
- args = [] of String
- (start..array.size + start - 1).each { |i| args << "($#{i})" }
- args = args.join(",")
+ if array.size == 0
+ args = "NULL"
+ else
+ args = [] of String
+ (start..array.size + start - 1).each { |i| args << "($#{i})" }
+ args = args.join(",")
+ end
return args
end