Encountering a fatal error
TypeError: Cannot read properties of null (reading 'propThatSometimesDoesNotExist')
when utilizing the code below:
<template>
<div>
<img v-if="obj.propThatSometimesDoesNotExist" :src="obj.propThatSometimesDoesNotExist">
</div>
</template>
A computed property resolves the issue, but it's not suitable for my specific situation (the above code is a simplified excerpt from my project).
Is there a way to maintain the syntax above while preventing fatal errors? Possibly utilizing something similar to optional chaining, like
:src="obj?.propThatSometimesDoesNotExist"
(even though this syntax is not functional)?