RED-8711 - check for positions property to be sure it exists and is not null

This commit is contained in:
Valentin Mihai 2024-04-10 12:49:34 +03:00
parent 9232d426a9
commit 313eeef0ae

View File

@ -27,7 +27,7 @@ export class EntityLogService extends GenericService<unknown> {
#filterInvalidEntries(entityLogEntry: IEntityLogEntry[]) {
return entityLogEntry.filter(entry => {
entry.positions = entry.positions.filter(p => !!p.rectangle?.length);
entry.positions = entry.positions?.filter(p => !!p.rectangle?.length);
const hasPositions = !!entry.positions?.length;
const isRemoved = entry.state === EntryStates.REMOVED;
if (!hasPositions) {