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:47:15 +03:00
parent a9465c854a
commit 2abf0aefab

View File

@ -26,7 +26,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) {