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>
This commit is contained in:
Lukas Reschke 2016-11-22 18:23:48 +01:00
parent 717fd9fdd6
commit e827be759d
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1

View file

@ -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);
}
}