[gnome-maps/wip/jonasdn/service-gnome-3-14: 3/3] fix2



commit 596cf6fd76998ff7e7ba9a48b78b28225f77bdc4
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Fri Aug 19 20:18:18 2016 +0200

    fix2

 src/mapSource.js |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/mapSource.js b/src/mapSource.js
index b82b232..0b5fd55 100644
--- a/src/mapSource.js
+++ b/src/mapSource.js
@@ -48,7 +48,11 @@ const AttributionLogo = new Lang.Class({
 
     _init: function(view) {
         this.parent();
-        this.contents = _attributionImage;
+
+        if (_attributionImage)
+            this.contents = _attributionImage;
+        else
+            return;
 
         view.connect('notify::width', (function() {
             this._updatePosition(view);
@@ -72,14 +76,12 @@ const AttributionLogo = new Lang.Class({
 });
 
 function _updateAttributionImage(source) {
+    if (!source.attribution_logo || source.attribution_logo === "")
+        return;
+
     if (!_attributionImage)
         _attributionImage = new Gtk.Image();
 
-    if (!source.attribution_logo || source.attribution_logo === "") {
-        _attributionImage.visible = false;
-        return;
-    }
-
     let data = GLib.base64_decode(source.attribution_logo);
     let stream = Gio.MemoryInputStream.new_from_bytes(GLib.Bytes.new(data));
     _attributionImage.pixbuf = GdkPixbuf.Pixbuf.new_from_stream(stream, null);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]