From 5a208ebb17f886068c668851dde75700fc408e80 Mon Sep 17 00:00:00 2001 From: kittapath Date: Sun, 25 Aug 2024 16:31:22 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Application/Repositories/UserProfileRepository.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BMA.EHR.Application/Repositories/UserProfileRepository.cs b/BMA.EHR.Application/Repositories/UserProfileRepository.cs index 2e7ccfdc..2df2f5e0 100644 --- a/BMA.EHR.Application/Repositories/UserProfileRepository.cs +++ b/BMA.EHR.Application/Repositories/UserProfileRepository.cs @@ -371,9 +371,10 @@ namespace BMA.EHR.Application.Repositories var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey); if (apiResult.Result != null) { - var raw = JsonConvert.DeserializeObject(apiResult.Result); - if (raw != null) - return raw.Result!.RootId; + var raw = JsonConvert.DeserializeObject(apiResult.Result); + if (raw == null || raw.RootId == null) + return Guid.Empty; + return raw.RootId; } return Guid.Empty;