diff --git a/packages/vue/src/components/AdvancedImage.vue b/packages/vue/src/components/AdvancedImage.vue index 876b3eb4..61878e17 100644 --- a/packages/vue/src/components/AdvancedImage.vue +++ b/packages/vue/src/components/AdvancedImage.vue @@ -152,6 +152,7 @@ onMounted(() => { * cloudinaryImage and the state of plugins. */ onUpdated(() => { + if (!htmlLayerInstance) return; cancelCurrentlyRunningPlugins(htmlLayerInstance.htmlPluginState); // call html layer to update the dom again with plugins and reset toBeCanceled htmlLayerInstance.update(props.cldImg, props.plugins, SDKAnalyticsConstants); @@ -161,7 +162,7 @@ onUpdated(() => { * On unmount, we cancel the currently running plugins. */ onUnmounted(() => { - // Safely cancel running events on unmount. + if (!htmlLayerInstance) return; cancelCurrentlyRunningPlugins(htmlLayerInstance.htmlPluginState); }); diff --git a/packages/vue/src/components/AdvancedVideo.vue b/packages/vue/src/components/AdvancedVideo.vue index ca66ca53..8127a5c1 100644 --- a/packages/vue/src/components/AdvancedVideo.vue +++ b/packages/vue/src/components/AdvancedVideo.vue @@ -64,6 +64,7 @@ onMounted(() => { * cloudinaryVideo and the state of plugins. */ onUpdated(() => { + if (!htmlLayerInstance) return; cancelCurrentlyRunningPlugins(htmlLayerInstance.htmlPluginState); // call html layer to update the dom again with plugins and reset toBeCanceled htmlLayerInstance.update( @@ -79,7 +80,7 @@ onUpdated(() => { * On unmount, we cancel the currently running plugins. */ onUnmounted(() => { - // Safely cancel running events on unmount. + if (!htmlLayerInstance) return; cancelCurrentlyRunningPlugins(htmlLayerInstance.htmlPluginState); });