From e827be759d11fea60da975e24ae31006dad050df Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 22 Nov 2016 18:23:48 +0100 Subject: [PATCH] Check if data is defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- settings/js/users/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 7e70d98f09..71defeaa18 100644 --- a/settings/js/users/users.js +++ b/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); } }