Check if inventory is undefined before assigning pending_deletion flag

This commit is contained in:
Marliana Lara 2017-08-07 16:01:07 -04:00
parent ced871f34b
commit 4abefbfe7e

View File

@ -106,7 +106,7 @@ function InventoriesList($scope,
$scope.$on(`ws-inventories`, function(e, data){
let inventory = $scope.inventories.find((inventory) => inventory.id === data.inventory_id);
if (data.status === 'pending_deletion') {
if (data.status === 'pending_deletion' && inventory !== undefined) {
inventory.pending_deletion = true;
}
if (data.status === 'deleted') {