Skip to content

Commit

Permalink
✨ classic: add typeof object check for pairTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrovismara committed Jun 10, 2024
1 parent 110f01d commit 0b357d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/classic/src/relation/Relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const getRelationTargets = (world: World, relation: RelationType<any>, ei
const targets = [];
for (const c of components) {
if (c[$relation] === relation && c[$pairTarget] !== Wildcard) {
if (c[$pairTarget][$worldToPrefab]) {
if (typeof c[$pairTarget] === 'object' && c[$pairTarget][$worldToPrefab]) {
// It's a prefab
let eid = c[$pairTarget][$worldToPrefab].get(world);
if (eid == null) {
Expand Down

0 comments on commit 0b357d9

Please sign in to comment.