Skip to content

Commit

Permalink
lib(api/assets): skip if asset index faulty
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Jun 14, 2024
1 parent 3ed0f77 commit bf21e98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ const config = {
"transform-named-capturing-groups-regex",
"transform-nullish-coalescing-operator",
"transform-object-rest-spread",
"transform-optional-chaining"
"transform-optional-chaining",
"transform-logical-assignment-operators"
]
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/lib/api/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const assetsMap: Record<string, Asset> = new Proxy<any>({}, {
const assetIndex = requireModule(Number(id));
const assetDefinition = assetsModule.getAssetByID(assetIndex);

// TODO: we shouldn't need this, this should never happen (unreproducible)
if (!assetDefinition) continue;

assetDefinition.index ??= assetDefinition.id ??= assetIndex;
assetDefinition.moduleId ??= id;

Expand Down

0 comments on commit bf21e98

Please sign in to comment.