changeset 3683:4a00ff7e44f0

client: fairway profile: avoid console error spamming by properly checking properties
author Markus Kottlaender <markus@intevation.de>
date Tue, 18 Jun 2019 13:21:41 +0200
parents c086f5176ef2
children 2babdaa32709
files client/src/components/fairway/Fairwayprofile.vue client/src/components/fairway/Profiles.vue
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Tue Jun 18 12:53:05 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Tue Jun 18 13:21:41 2019 +0200
@@ -1,7 +1,7 @@
 <template>
   <div class="d-flex flex-column flex-fill">
     <UIBoxHeader icon="chart-area" :title="title" :closeCallback="close" />
-    <div class="d-flex flex-fill">
+    <div class="d-flex flex-fill" v-if="openLayersMap()">
       <DiagramLegend>
         <div class="legend">
           <span
--- a/client/src/components/fairway/Profiles.vue	Tue Jun 18 12:53:05 2019 +0200
+++ b/client/src/components/fairway/Profiles.vue	Tue Jun 18 13:21:41 2019 +0200
@@ -427,10 +427,12 @@
     },
     bottleneck() {
       return this.openLayersMap()
-        .getLayer("BOTTLENECKS")
-        .getSource()
-        .getFeatures()
-        .find(f => f.get("objnam") === this.selectedBottleneck);
+        ? this.openLayersMap()
+            .getLayer("BOTTLENECKS")
+            .getSource()
+            .getFeatures()
+            .find(f => f.get("objnam") === this.selectedBottleneck)
+        : null;
     }
   },
   watch: {