From 8f607599e58766e5f8d22b207911378a81a1fa03 Mon Sep 17 00:00:00 2001 From: Fernando Almeida Date: Sat, 6 Feb 2021 03:25:57 +0000 Subject: [PATCH] Fix bug in LIcon not properly referencing parent container's map object, in particular when using a custom vue-component. --- src/components/LIcon.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/LIcon.vue b/src/components/LIcon.vue index ea3b2527..de570931 100644 --- a/src/components/LIcon.vue +++ b/src/components/LIcon.vue @@ -92,8 +92,10 @@ export default { mounted() { this.parentContainer = findRealParent(this.$parent); - - propsBinder(this, this.$parent.mapObject, this.$options.props); + if (!this.parentContainer) { + throw new Error('No parent container with mapObject found for LIcon'); + } + propsBinder(this, this.parentContainer.mapObject, this.$options.props); this.observer = new MutationObserver(() => { this.scheduleHtmlSwap();