Don't try to return an element from an empty set

This commit is contained in:
Bastien Dejean
2016-11-17 14:12:31 +01:00
parent b3d58fba00
commit fe738ef101

View File

@@ -57,6 +57,9 @@ local function getRandomImage(dir)
end
end
end
if i == 0 then
return nil
end
return createWidgetFromFile(dir .. pics[math.random(i)])
end