[gnome-maps/wip/mlundblad/fix-unfavorite: 3/3] placeStore: Don't match existing place on null




commit d4cda6b7e497bed318bc965f055c43e1db7b92c9
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Mar 30 22:03:42 2021 +0200

    placeStore: Don't match existing place on null
    
    Don't match existing places on null when not
    specifying type. This avoid returning true
    when place was unfavored and marked with
    null in the mapping.

 src/placeStore.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index 72bf50ab..8dd8ed4a 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -320,7 +320,8 @@ class PlaceStore extends Gtk.ListStore {
         if (type !== undefined && type !== null && this._typeTable[place.uniqueID] !== undefined)
             return this._typeTable[place.uniqueID] === type;
         else
-            return this._typeTable[place.uniqueID] !== undefined;
+            return this._typeTable[place.uniqueID] !== undefined &&
+                   this._typeTable[place.uniqueID] !== null;
     }
 
     existsWithOsmTypeAndId(osmType, osmId) {


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