Skip to content

Commit

Permalink
Fix script attribute data retrieval in ScriptComponentSystem to handl…
Browse files Browse the repository at this point in the history
…e undefined cases gracefully (#7251)
  • Loading branch information
marklundin authored Jan 7, 2025
1 parent 882b420 commit 2bce6f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/components/script/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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];
}
Expand Down

0 comments on commit 2bce6f9

Please sign in to comment.