From 0cdd004eb111f6db8425c882f08ebcb1697b8c6a Mon Sep 17 00:00:00 2001 From: Santy-Wang Date: Wed, 10 Jul 2019 16:55:36 +0800 Subject: [PATCH] fix decompression of json (#4852) --- cocos/load-pipeline/utils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos/load-pipeline/utils.js b/cocos/load-pipeline/utils.js index a6d80369e3..8ad1d67112 100644 --- a/cocos/load-pipeline/utils.js +++ b/cocos/load-pipeline/utils.js @@ -48,9 +48,12 @@ export function decompressJson (data, keys) { } else if (typeof data === 'object') { for (var key in data) { - data[keys[key]] = data[key]; decompressJson(data[key], keys); - delete data[key]; + var newKey = keys[key]; + if (newKey) { + data[newKey] = data[key]; + delete data[key]; + } } } return null;