From a28a68889d1714746b745a7b4a959902a6535d89 Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Wed, 9 Sep 2020 15:01:00 -0400 Subject: [PATCH] Null ref exception when saving config fix (#927) --- bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs b/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs index a9a7edb87..cc656503c 100644 --- a/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs +++ b/bitwarden_license/src/Portal/Models/SsoConfigDataViewModel.cs @@ -210,6 +210,10 @@ namespace Bit.Portal.Models private string StripPemCertificateElements(string certificateText) { + if (string.IsNullOrWhiteSpace(certificateText)) + { + return null; + } return Regex.Replace(certificateText, @"(((BEGIN|END) CERTIFICATE)|([\-\n\r\t\s\f]))", string.Empty,