From 76c9dbc751687b09f62e31e81e3866ce869a6554 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Tue, 6 Jun 2023 11:20:15 -0700 Subject: [PATCH] Fix invalid undefined dereferences during explorer init --- etc/js/app.js | 18 ++++++++++++++---- etc/js/entity_inspector.js | 4 ++-- etc/js/query.js | 4 +++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/etc/js/app.js b/etc/js/app.js index 59163c5b..93c60e71 100644 --- a/etc/js/app.js +++ b/etc/js/app.js @@ -681,26 +681,36 @@ var app = new Vue({ }, refresh_query() { - this.$refs.query.refresh(); + if (this.$refs.query) { + this.$refs.query.refresh(); + } }, refresh_entity() { - this.$refs.inspector.refresh(); + if (this.$refs.inspector) { + this.$refs.inspector.refresh(); + } }, refresh_tree() { - this.$refs.tree.update_expanded(); + if (this.$refs.tree) { + this.$refs.tree.update_expanded(); + } }, refresh_stats() { if (this.$refs.stats_world) { this.$refs.stats_world.refresh(); + } + if (this.$refs.stats_pipeline) { this.$refs.stats_pipeline.refresh(); } }, refresh_alerts() { - this.$refs.alerts.refresh(); + if (this.$refs.alerts) { + this.$refs.alerts.refresh(); + } }, // Entity selected diff --git a/etc/js/entity_inspector.js b/etc/js/entity_inspector.js index cb89482e..7bd97587 100644 --- a/etc/js/entity_inspector.js +++ b/etc/js/entity_inspector.js @@ -1089,9 +1089,9 @@ const inspector_component = Vue.component('inspector', { diff --git a/etc/js/query.js b/etc/js/query.js index 5e38a184..e7c91ecd 100644 --- a/etc/js/query.js +++ b/etc/js/query.js @@ -131,7 +131,9 @@ Vue.component('query', { } }, set_offset_limit(offset, limit) { - this.$refs.footer.set_offset_limit(offset, limit); + if (this.$refs.footer) { + this.$refs.footer.set_offset_limit(offset, limit); + } }, get_error() { return this.query_error;