background: fix early destroy of SystemBackground

If the SystemBackground is destroyed before loading, we call
removeImageContent() with null, which crashes.
This commit is contained in:
Giovanni Campagna 2014-06-26 18:45:06 +02:00
parent b742b1eed2
commit cfef107114

View File

@ -659,7 +659,10 @@ const SystemBackground = new Lang.Class({
},
_onDestroy: function() {
this._cache.removeImageContent(this.actor.content);
let content = this.actor.content;
if (content)
this._cache.removeImageContent(content);
},
});
Signals.addSignalMethods(SystemBackground.prototype);