Merge pull request #826 from MihaelaStoica/master

Fix null reference exception that can occur when running the tests
This commit is contained in:
Gabor Apati-Nagy 2016-02-10 10:51:12 +00:00
commit 9fdec14cd1

View File

@ -164,7 +164,7 @@ namespace XenAdmin.Dialogs
{
get
{
return LicencedHost.license_params.ContainsKey("grace") && LicenseExpiresIn.Ticks > 0 && LicencedHost.license_params["grace"] == "regular grace";
return LicencedHost.license_params != null && LicencedHost.license_params.ContainsKey("grace") && LicenseExpiresIn.Ticks > 0 && LicencedHost.license_params["grace"] == "regular grace";
}
}
@ -172,7 +172,7 @@ namespace XenAdmin.Dialogs
{
get
{
return LicencedHost.license_params.ContainsKey("grace") && LicenseExpiresIn.Ticks > 0 && LicencedHost.license_params["grace"] == "upgrade grace";
return LicencedHost.license_params != null && LicencedHost.license_params.ContainsKey("grace") && LicenseExpiresIn.Ticks > 0 && LicencedHost.license_params["grace"] == "upgrade grace";
}
}
@ -313,7 +313,7 @@ namespace XenAdmin.Dialogs
{
get
{
if (LicencedHost.license_params.ContainsKey("expiry"))
if (LicencedHost.license_params != null && LicencedHost.license_params.ContainsKey("expiry"))
return LicencedHost.LicenseExpiryUTC.ToLocalTime();
return null;
}