background: Fix a bug with empty animations

Arrays always evaluate to true, even empty arrays,
so we need to check the length to make sure we have
no files.

https://bugzilla.gnome.org/show_bug.cgi?id=695882
This commit is contained in:
Jasper St. Pierre 2013-03-14 17:06:17 -04:00
parent 3a27d0b849
commit 8edd7ad32e

View File

@ -387,7 +387,7 @@ const Background = new Lang.Class({
this._animation.update(this._layoutManager.monitors[this._monitorIndex]);
let files = this._animation.keyFrameFiles;
if (!files) {
if (files.length == 0) {
this._setLoaded();
this._queueUpdateAnimation();
return;