RED-6813: check for undefined

This commit is contained in:
Dan Percic 2023-05-24 10:58:27 +03:00
parent 24ff24cfcb
commit 758fecb94c

View File

@ -361,7 +361,7 @@ export class AnnotationWrapper implements IListable, Record<string, unknown> {
const viableChanges = redactionLogEntryWrapper.changes.filter(c => c.analysisNumber > 1); const viableChanges = redactionLogEntryWrapper.changes.filter(c => c.analysisNumber > 1);
const lastChange = viableChanges.sort(chronologicallyBy(x => x.dateTime)).at(-1); const lastChange = viableChanges.sort(chronologicallyBy(x => x.dateTime)).at(-1);
const lastChangeOccurredAfterLastManualChange = const lastChangeOccurredAfterLastManualChange =
timestampOf(lastChange.dateTime) > timestampOf(lastRelevantManualChange.processedDate); lastChange && timestampOf(lastChange.dateTime) > timestampOf(lastRelevantManualChange.processedDate);
if (lastChangeOccurredAfterLastManualChange && lastChange.type === ChangeTypes.ADDED && redactionLogEntryWrapper.redacted) { if (lastChangeOccurredAfterLastManualChange && lastChange.type === ChangeTypes.ADDED && redactionLogEntryWrapper.redacted) {
annotationWrapper.superType = SuperTypes.Redaction; annotationWrapper.superType = SuperTypes.Redaction;