Fixed an error when deleting categories from library items without any settings

This commit is contained in:
Stefan Zermatten
2019-05-06 14:54:30 +02:00
parent 85e3b0724a
commit b3aeaf06ea

View File

@@ -157,7 +157,7 @@ Template.inventory.events({
}
// Make the library item into a regular item
let item = _.omit(result, "libraryName", "library", "attacks", "effects");
delete item.settings.category;
if (item.settings && item.settings.category) delete item.settings.category;
// Update the item to match library item
Items.update(itemId, {$set: item});
// Copy over attacks and effects