diff client/src/application/Morphtool.vue @ 836:0b994949a4a0

client: make Morphtool selection more robust * Check if the selected features we are testing has an id before operating on it.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 28 Sep 2018 10:17:11 +0200
parents 797063af6dc8
children b1489669ba52
line wrap: on
line diff
--- a/client/src/application/Morphtool.vue	Fri Sep 28 10:13:54 2018 +0200
+++ b/client/src/application/Morphtool.vue	Fri Sep 28 10:17:11 2018 +0200
@@ -65,7 +65,8 @@
     selectedBottleneck: function() {
       if (this.identifiedFeatures) {
         for (let feature of this.identifiedFeatures) {
-          if (feature.getId().replace(/[.][^.]*$/, "") === "bottlenecks") {
+          let id = feature.getId();
+          if (id && id.replace(/[.][^.]*$/, "") === "bottlenecks") {
             return feature;
           }
         }
@@ -85,6 +86,7 @@
   },
   methods: {
     queryBottleneck(name) {
+      // DEBUG console.log("starting to query bottleneck", name);
       HTTP.get("/surveys/" + name, {
         headers: {
           "X-Gemma-Auth": localStorage.getItem("token"),