Skip to content

Commit

Permalink
check for elements existence before using them
Browse files Browse the repository at this point in the history
  • Loading branch information
walsh9 committed May 30, 2024
1 parent 0fd1116 commit 9c85d96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion components/EmailCollectorForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ onMounted(() => {
// this is a known bug: https://github.com/nuxt/framework/issues/3587
setTimeout(() => {
// gets the width of the submit button to set the padding right on the input field
submitButtonWidth.value = submitButtonRef.value.offsetWidth + 20
if (submitButtonRef.value)
submitButtonWidth.value = submitButtonRef.value.offsetWidth + 20
}, 500)
})
Expand Down
4 changes: 2 additions & 2 deletions components/HorizontalDrag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ onMounted(() => {
})
onBeforeUnmount(() => {
// kill draggable
if (isMobile.value)
Draggable.get(dragContentRef.value).kill()
if (isMobile.value && dragContentRef.value)
Draggable.get(dragContentRef.value)?.kill()
})
</script>

Expand Down

0 comments on commit 9c85d96

Please sign in to comment.