summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--settings/js/users.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/settings/js/users.js b/settings/js/users.js
index 7ed6c50d588..9fe593214f2 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -449,8 +449,10 @@ $(document).ready(function () {
OC.dialogs.alert(result.data.message,
t('settings', 'Error creating user'));
} else {
- var addedGroups = result.data.groups.split(', ');
- UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
+ if (result.data.groups) {
+ var addedGroups = result.data.groups.split(', ');
+ UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
+ }
if($('tr[data-uid="' + username + '"]').length === 0) {
UserList.add(username, username, result.data.groups, null, 'default', true);
}