Fixed console error if creature is deleted while sheet is still showing

This commit is contained in:
Stefan Zermatten
2021-04-13 11:53:18 +02:00
parent ce9b9199ec
commit 1eb78756ac

View File

@@ -434,7 +434,8 @@
return getProperties(this.creature, {type: 'buff', applied: true});
},
attacks(){
let props = getProperties(this.creature, {type: 'attack'}).map(attack => {
let props = getProperties(this.creature, {type: 'attack'})
return props && props.map(attack => {
attack.children = CreatureProperties.find({
'ancestors.id': attack._id,
removed: {$ne: true},
@@ -444,7 +445,6 @@
});
return attack;
});
return props;
},
},
methods: {