diff options
author | Matt Watson <mattdangerw@gmail.com> | 2013-11-06 12:09:07 -0800 |
---|---|---|
committer | Matt Watson <mattdangerw@gmail.com> | 2013-11-06 12:55:56 -0800 |
commit | 5f31001fa614c3f8fc0a2d05167ff3032776dc57 (patch) | |
tree | cb113faf3a94ff21d8be00384126bc5eb33f0fc6 /overrides/endless_private | |
parent | 8ee7d03943dfc7531c09c1a128bc49dbe821e2ed (diff) |
Fixed bug in asset button image loading
If loading a file for one of the states of the asset button failed
we would call close on an undefined object, which caused a crash.
[endlessm/eos-sdk#390]
Diffstat (limited to 'overrides/endless_private')
-rw-r--r-- | overrides/endless_private/asset_button.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/overrides/endless_private/asset_button.js b/overrides/endless_private/asset_button.js index b1cee97..594581e 100644 --- a/overrides/endless_private/asset_button.js +++ b/overrides/endless_private/asset_button.js @@ -137,7 +137,7 @@ const AssetButton = new Lang.Class({ if(this[uri_property] === uri) return; - let img_stream; + let img_stream = null; try { img_stream = this._open_stream_from_uri(uri); this[pixbuf_property] = GdkPixbuf.Pixbuf.new_from_stream(img_stream, null); @@ -147,7 +147,8 @@ const AssetButton = new Lang.Class({ this[pixbuf_property] = null; this[uri_property] = null; } - img_stream.close(null); + if (img_stream !== null) + img_stream.close(null); this._update_appearance(); this.notify(state + '-image-uri'); } |