Merge pull request #241 from GaborApatiNagy/CA-148233

CA-148233: Uncaught exception in XenCenter on "Disconnect All"
This commit is contained in:
Mihaela Stoica 2014-10-08 16:07:03 +01:00
commit 11ca05e211

View File

@ -233,12 +233,12 @@ namespace XenAPI
if (Helpers.MidnightRideOrGreater(connection)) if (Helpers.MidnightRideOrGreater(connection))
{ {
if (connection.Session.IsLocalSuperuser) if (connection.Session != null && connection.Session.IsLocalSuperuser)
return true; return true;
foreach (Role role in validRoleList) foreach (Role role in validRoleList)
{ {
if (connection.Session.Roles.Contains(role)) if (connection.Session != null && connection.Session.Roles != null && connection.Session.Roles.Contains(role))
return true; return true;
} }
} }