Check if data is defined

Otherwise when adding a user as subadmin this would throw the following JS error:

```
users.js?v=bc2aae7…:500 Uncaught TypeError: Cannot read property 'message' of undefined(…)(anonymous function) @ users.js?v=bc2aae7…:500j @ jquery.js:3099fireWith @ jquery.js:3211x @ jquery.js:8264(anonymous function) @ jquery.js:8605
```

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
pull/2250/head
Lukas Reschke 9 years ago
parent 717fd9fdd6
commit e827be759d
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
  1. 2
      settings/js/users/users.js

@ -497,7 +497,7 @@ var UserList = {
group: group
},
function (response) {
if (response.data.message) {
if (response.data !== undefined && response.data.message) {
OC.Notification.show(response.data.message);
}
}

Loading…
Cancel
Save