[gnome-maps] http: Check property before use in expression



commit 48f10781d7e3c89ff3aed734cdfb6a8159588a9d
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Nov 7 22:39:49 2017 +0100

    http: Check property before use in expression
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782861

 src/http.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/http.js b/src/http.js
index 2d7a7c4..482e3aa 100644
--- a/src/http.js
+++ b/src/http.js
@@ -42,7 +42,8 @@ var Query = new Lang.Class({
     // a value === null represents an empty value
     add: function(key, value) {
         // Initialize query field if it isn't already
-        if(!Array.isArray(this._query[key]))
+        let queryValue = this._query[key];
+        if(!Array.isArray(queryValue))
             this._query[key] = [];
 
         if(Array.isArray(value))


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