summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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