fix: guard

This commit is contained in:
cha0s 2020-06-28 12:47:09 -05:00
parent d647002ac3
commit 048cc91fbf

View File

@ -112,6 +112,9 @@ export default class Spawner extends decorate(Trait) {
} }
static optionsForSpawn(entity) { static optionsForSpawn(entity) {
if (!entity) {
return undefined;
}
return Object.keys(entity.traitInstance('spawner').params.spawns) return Object.keys(entity.traitInstance('spawner').params.spawns)
.reduce((r, key) => ({...r, [key]: key}), {}); .reduce((r, key) => ({...r, [key]: key}), {});
} }