My code is something like below and I keep getting 'object is possibly undefined' error with red lines under telemetryData .get(cid). Not sure how to solve this issue? Thanks!
const updateLoadedCount = mutatorAction('updateLoadedCount', (cid: string) => {
const telemetryData = getTelemetryStore()?.telemetryData;
if (telemetryData?.has(cid)) {
if (telemetryData .get(cid) !== undefined) {
telemetryData .get(cid).imageLoaded =
telemetryData .get(cid).imageLoaded + 1;
}
}
})