Skip to content

Commit

Permalink
cherry-pick(#6904): Check for null in DuplicateAction (#6911)
Browse files Browse the repository at this point in the history
check for null before checking before hasOwnProperty

Co-authored-by: Scott Bell <scott@traclabs.com>
  • Loading branch information
ozyx and scottbell committed Aug 9, 2023
1 parent 32b68cf commit 339640e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/duplicate/DuplicateTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ export default class DuplicateTask {
// parse reviver to replace identifiers
clonedParent = JSON.parse(clonedParent, (key, value) => {
if (
value !== null &&
value !== undefined &&
Object.prototype.hasOwnProperty.call(value, 'key') &&
Object.prototype.hasOwnProperty.call(value, 'namespace') &&
value.key === oldId.key &&
Expand Down

0 comments on commit 339640e

Please sign in to comment.