From bf04b9f9400bd8e906f6db2b5ca323b5db9452b7 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:49:05 -0400 Subject: [PATCH] Fix null ref exception for new org SSO (#963) --- bitwarden_license/src/Portal/Controllers/SsoController.cs | 2 +- .../src/Portal/Models/SsoConfigEditViewModel.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bitwarden_license/src/Portal/Controllers/SsoController.cs b/bitwarden_license/src/Portal/Controllers/SsoController.cs index 363d9bbc68..f5e05f7f82 100644 --- a/bitwarden_license/src/Portal/Controllers/SsoController.cs +++ b/bitwarden_license/src/Portal/Controllers/SsoController.cs @@ -47,7 +47,7 @@ namespace Bit.Portal.Controllers } var ssoConfig = await _ssoConfigRepository.GetByOrganizationIdAsync(orgId.Value); - var model = new SsoConfigEditViewModel(ssoConfig, _i18nService, _globalSettings); + var model = new SsoConfigEditViewModel(ssoConfig, orgId.Value, _i18nService, _globalSettings); return View(model); } diff --git a/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs b/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs index e2ad77d3fc..9e384061da 100644 --- a/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs +++ b/bitwarden_license/src/Portal/Models/SsoConfigEditViewModel.cs @@ -18,8 +18,8 @@ namespace Bit.Portal.Models { public SsoConfigEditViewModel() { } - public SsoConfigEditViewModel(SsoConfig ssoConfig, II18nService i18nService, - GlobalSettings globalSettings) + public SsoConfigEditViewModel(SsoConfig ssoConfig, Guid organizationId, + II18nService i18nService, GlobalSettings globalSettings) { if (ssoConfig != null) { @@ -41,7 +41,7 @@ namespace Bit.Portal.Models configurationData = new SsoConfigurationData(); } - Data = new SsoConfigDataViewModel(configurationData, globalSettings, ssoConfig.OrganizationId); + Data = new SsoConfigDataViewModel(configurationData, globalSettings, organizationId); BuildLists(i18nService); }