From 0b357d90d586288ba93b26b6dc20984c384bb8ff Mon Sep 17 00:00:00 2001 From: pietrovismara Date: Mon, 10 Jun 2024 16:24:19 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20classic:=20add=20typeof=20object=20?= =?UTF-8?q?check=20for=20pairTarget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/classic/src/relation/Relation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/classic/src/relation/Relation.ts b/packages/classic/src/relation/Relation.ts index 244a6fd4..ef2707d9 100644 --- a/packages/classic/src/relation/Relation.ts +++ b/packages/classic/src/relation/Relation.ts @@ -70,7 +70,7 @@ export const getRelationTargets = (world: World, relation: RelationType, 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) {