cherry-pick(#6904): Check for null in DuplicateAction (#6911)

check for null before checking before hasOwnProperty

Co-authored-by: Scott Bell <scott@traclabs.com>
This commit is contained in:
Jesse Mazzella 2023-08-09 14:42:09 -07:00 committed by GitHub
parent 32b68cf0df
commit 339640e0d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 &&