Skip to content

Commit

Permalink
runfix: apply sanity check on correct object (#14519)
Browse files Browse the repository at this point in the history
  • Loading branch information
atomrc committed Jan 19, 2023
1 parent 5ff525a commit 17b742f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/event/EventRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@ export class EventRepository {
}

private handleEventReplacement(originalEvent: EventRecord, newEvent: EventRecord): Promise<EventRecord> {
const newData = newEvent.data || {};
if (originalEvent.data.from !== newData.from) {
if (originalEvent.from !== newEvent.from) {
const logMessage = `ID previously used by user '${newEvent.from}'`;
const errorMessage = 'ID reused by other user';
this.throwValidationError(newEvent, errorMessage, logMessage);
}
const newData = newEvent.data || {};
const primaryKeyUpdate = {primary_key: originalEvent.primary_key};
const isLinkPreviewEdit = newData.previews && !!newData.previews.length;

Expand Down

0 comments on commit 17b742f

Please sign in to comment.