summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-04-01 09:46:13 -0500
committerOmar Roth <omarroth@hotmail.com>2018-04-01 09:46:13 -0500
commit172fc72fa9baa00d85e33596fa4c2c7683771893 (patch)
tree909a25e96aadb61387617168fd78eb988e273b18 /src
parent0438572c586497781ed039043d487802942c9d77 (diff)
downloadinvidious-172fc72fa9baa00d85e33596fa4c2c7683771893.tar.gz
invidious-172fc72fa9baa00d85e33596fa4c2c7683771893.tar.bz2
invidious-172fc72fa9baa00d85e33596fa4c2c7683771893.zip
Fix arg_array on empty
Diffstat (limited to 'src')
-rw-r--r--src/helpers.cr10
1 files changed, 7 insertions, 3 deletions
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