diff --git a/components/lib/config/PrimeVue.js b/components/lib/config/PrimeVue.js index b10d0e4e4..6f2b2e0a7 100644 --- a/components/lib/config/PrimeVue.js +++ b/components/lib/config/PrimeVue.js @@ -160,7 +160,7 @@ function switchTheme(currentTheme, newTheme, linkElementId, callback) { callback(); } }); - linkElement.parentNode?.insertBefore(cloneLinkElement, linkElement.nextSibling); + linkElement.parentNode && linkElement.parentNode.insertBefore(cloneLinkElement, linkElement.nextSibling); } export default { diff --git a/components/lib/virtualscroller/VirtualScroller.vue b/components/lib/virtualscroller/VirtualScroller.vue index 89a3d5e85..6bcaf9918 100644 --- a/components/lib/virtualscroller/VirtualScroller.vue +++ b/components/lib/virtualscroller/VirtualScroller.vue @@ -231,7 +231,7 @@ export default { }, scrollTo(options) { this.lastScrollPos = this.both ? { top: 0, left: 0 } : 0; - this.element?.scrollTo(options); + this.element && this.element.scrollTo(options); }, scrollToIndex(index, behavior = 'auto') { const both = this.isBoth();