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 committed Jan 8, 2025
1 parent 5830938 commit f868729
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 @@ -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];
}
Expand Down

0 comments on commit f868729

Please sign in to comment.