Check if variable exists before comparing. Fixes #316

This commit is contained in:
brantje 2017-06-13 23:28:17 +02:00
parent 888d699d8c
commit 675abec7a5
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 2 additions and 2 deletions

View file

@ -216,7 +216,7 @@
};
var found = false;
for (var z = 0; z < $scope.share_settings.credentialSharedWithUserAndGroup.length; z++) {
if ($scope.share_settings.credentialSharedWithUserAndGroup[z].userId === shareWith[z].uid) {
if (shareWith[z] && $scope.share_settings.credentialSharedWithUserAndGroup[z].userId === shareWith[z].uid) {
found = true;
}
}

View file

@ -17,7 +17,7 @@
<td>
<button class="button"
ng-click="shareWith(inputSharedWith, selectedAccessLevel)">
ng-click="shareWith(inputSharedWith)">
+
</button>
</td>