[gnome-maps/wip/osm-edit: 11/47] osmApi: Don't parse NULL output from the shim layer



commit b141d25940b285b32bb27771590be6de0c2c1267
Author: Marcus Lundblad <marcus lundblad primekey se>
Date:   Sun Feb 1 10:09:32 2015 +0100

    osmApi: Don't parse NULL output from the shim layer

 src/osmConnection.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/osmConnection.js b/src/osmConnection.js
index fbda662..6710254 100644
--- a/src/osmConnection.js
+++ b/src/osmConnection.js
@@ -86,7 +86,10 @@ const OSMConnection = new Lang.Class({
 
        print ('parsed XML to JSON: ' + jsonString);
        
-       return JSON.parse(jsonString);
+        if (jsonString)
+           return JSON.parse(jsonString);
+        else
+            return NULL;
     },
 
     _createObject: function(type, json) {


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