CA-148233: Uncaught exception in XenCenter on "Disconnect All"

This commit is contained in:
Gabor Apati-Nagy 2014-10-07 14:59:52 +01:00
parent 9f77454246
commit adae99a99e

View File

@ -233,12 +233,12 @@ namespace XenAPI
if (Helpers.MidnightRideOrGreater(connection))
{
if (connection.Session.IsLocalSuperuser)
if (connection.Session != null && connection.Session.IsLocalSuperuser)
return true;
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;
}
}