From f8687292c4c1ca8ea6d77ca4a6784090bd90ffaf Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Tue, 7 Jan 2025 14:28:56 +0000 Subject: [PATCH] Fix script attribute data retrieval in ScriptComponentSystem to handle undefined cases gracefully (#7251) --- src/framework/components/script/system.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/framework/components/script/system.js b/src/framework/components/script/system.js index 4056d781136..e1933b9b4d7 100644 --- a/src/framework/components/script/system.js +++ b/src/framework/components/script/system.js @@ -107,7 +107,7 @@ class ScriptComponentSystem extends ComponentSystem { const scriptName = scriptInstance.__scriptType.__name; order.push(scriptName); - const attributes = { }; + const attributes = entity.script._attributeDataMap?.get(scriptName) || { }; for (const key in scriptInstance.__attributes) { attributes[key] = scriptInstance.__attributes[key]; }