Check if params object exists

This commit is contained in:
Marliana Lara
2017-04-28 15:29:04 -04:00
parent a7dbb78c2e
commit 7386ed694a

View File

@@ -42,7 +42,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
}); });
} }
if ($state.params.organization_id) { if ($state.params && $state.params.organization_id) {
let id = $state.params.organization_id, let id = $state.params.organization_id,
url = GetBasePath('organizations') + id + '/'; url = GetBasePath('organizations') + id + '/';
@@ -57,7 +57,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
msg: `Failed to retrieve organization. GET status: ${status}` msg: `Failed to retrieve organization. GET status: ${status}`
}); });
}); });
}; }
if ($scope.removeChoicesReady) { if ($scope.removeChoicesReady) {
$scope.removeChoicesReady(); $scope.removeChoicesReady();