[gnome-maps/wip/osm-edit: 33/47] osmApi: properly check for null from the shim parser



commit dc4f671d880175380e8ae254d1d173b532e9fe59
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Feb 17 23:10:23 2015 +0100

    osmApi: properly check for null from the shim parser

 src/osmConnection.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/osmConnection.js b/src/osmConnection.js
index 74d9959..c93aa2b 100644
--- a/src/osmConnection.js
+++ b/src/osmConnection.js
@@ -99,7 +99,7 @@ const OSMConnection = new Lang.Class({
            jsonString = Maps.osm_parse_way(body.data, body.length);
             break;
         case 'relation':
-            jsonString = Maps.osm_parse_relation(body.data, body.lenght);
+            jsonString = Maps.osm_parse_relation(body.data, body.length);
            break;
         default:
             GLib.error('unknown OSM type: ' + type);
@@ -107,7 +107,7 @@ const OSMConnection = new Lang.Class({
 
        print ('parsed XML to JSON: ' + jsonString);
        
-        if (jsonString)
+        if (jsonString !== null)
            return JSON.parse(jsonString);
         else
             return NULL;


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