From 048cc91fbf9424ce5f310d78de4e8c590526493c Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 28 Jun 2020 12:47:09 -0500 Subject: [PATCH] fix: guard --- packages/entity/traits/spawner.trait.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/entity/traits/spawner.trait.js b/packages/entity/traits/spawner.trait.js index 86c5fce..ad05fb1 100644 --- a/packages/entity/traits/spawner.trait.js +++ b/packages/entity/traits/spawner.trait.js @@ -112,6 +112,9 @@ export default class Spawner extends decorate(Trait) { } static optionsForSpawn(entity) { + if (!entity) { + return undefined; + } return Object.keys(entity.traitInstance('spawner').params.spawns) .reduce((r, key) => ({...r, [key]: key}), {}); }