summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-02-15 11:55:44 -0600
committerOmar Roth <omarroth@hotmail.com>2018-02-15 11:55:44 -0600
commit89566233476b449772229856e0da0c74a01f88f2 (patch)
tree7cdab907c84739c1bfcdd914b2ffd2db313ae902 /src
parentd6b49bc0ae56e67bb3a7066d9311b2a754a082d6 (diff)
downloadinvidious-89566233476b449772229856e0da0c74a01f88f2.tar.gz
invidious-89566233476b449772229856e0da0c74a01f88f2.tar.bz2
invidious-89566233476b449772229856e0da0c74a01f88f2.zip
Add fix to top_videos for empty database
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 9b0bb7a7..1ca461c7 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -118,9 +118,13 @@ spawn do
client = get_client(pool)
args = [] of String
- (1..top.size).each { |i| args << "($#{i})," }
- args = args.join("")
- args = args.chomp(",")
+ if top.size > 0
+ (1..top.size).each { |i| args << "($#{i})," }
+ args = args.join("")
+ args = args.chomp(",")
+ else
+ next
+ end
videos = [] of Video