From bef740612ad47930cb3d7f186511628434da4d53 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 23 Jan 2018 10:08:07 +0100 Subject: [PATCH] Fixed bug: OTRS import fails for Roles without users assigned. --- lib/import/otrs/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/import/otrs/user.rb b/lib/import/otrs/user.rb index e6b2f2ecd..bf0258bcd 100644 --- a/lib/import/otrs/user.rb +++ b/lib/import/otrs/user.rb @@ -144,6 +144,7 @@ module Import def groups_from_otrs_group(role_object, group) result = [] + return result if role_object.blank? return result if role_object['GroupIDs'].blank? permissions = role_object['GroupIDs'][ group['ID'] ] @@ -165,7 +166,7 @@ module Import roles = Import::OTRS::Requester.load('Role') roles.each do |role| next if !user['RoleIDs'].include?(role['ID']) - result += groups_from_otrs_groups(role['GroupIDs']) + result += groups_from_otrs_groups(role) end result end