Skip to content

Commit

Permalink
Check if graph variables exist
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Sep 15, 2023
1 parent 5a95973 commit 60b6709
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inflators/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ export function inflateModel(world: HubsWorld, rootEid: number, { model }: Model

if (model.userData.behaviorGraph) {
const graph = model.userData.behaviorGraph as GraphJSON;
for (const variable of graph.variables!) {
variable.initialValue = resolveBGMHCLink(world, variable.initialValue as any, idx2eid, matIdx2eid);
if (graph.variables) {
for (const variable of graph.variables) {
variable.initialValue = resolveBGMHCLink(world, variable.initialValue as any, idx2eid, matIdx2eid);
}
}
for (const node of graph.nodes!) {
if (node.configuration) {
Expand Down

0 comments on commit 60b6709

Please sign in to comment.