Merge pull request #2353 from baskerville/random-image

Don't try to return an element from an empty set
This commit is contained in:
Frans de Jonge
2016-11-17 14:52:35 +01:00
committed by GitHub

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