Fix importing from JSON file where some property values are null (#3813)

This commit is contained in:
Shefali Joshi 2021-04-20 15:50:29 -07:00 committed by GitHub
parent 721bdd737a
commit 8157cdc7e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,9 @@ define(['zepto', 'objectUtils'], function ($, objectUtils) {
tree = JSON.stringify(tree).replace(new RegExp(oldIdKeyString, 'g'), newIdKeyString);
return JSON.parse(tree, (key, value) => {
if (Object.prototype.hasOwnProperty.call(value, 'key')
if (value !== undefined
&& value !== null
&& Object.prototype.hasOwnProperty.call(value, 'key')
&& Object.prototype.hasOwnProperty.call(value, 'namespace')
&& value.key === oldId.key
&& value.namespace === oldId.namespace) {