From 0a9403e8f545b98ae856d871909a2c17677503f6 Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 17 Apr 2024 10:05:06 +0100 Subject: [PATCH] TD-3741 - LMS server issue related to active content cache is null. --- LearningHub.Nhs.WebUI/Controllers/Api/ScormController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LearningHub.Nhs.WebUI/Controllers/Api/ScormController.cs b/LearningHub.Nhs.WebUI/Controllers/Api/ScormController.cs index cad178569..12adf699d 100644 --- a/LearningHub.Nhs.WebUI/Controllers/Api/ScormController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/Api/ScormController.cs @@ -230,6 +230,11 @@ private async Task Commit(SCO scoObject) try { var activeContent = this.userService.GetActiveContentAsync().Result; + if (activeContent.Count == 0) + { + return false; + } + if (!activeContent.Any(ac => ac.ScormActivityId == scoObject.InstanceId)) { throw new Exception($"User does not have ActiveContent for ScormActivityId={scoObject.InstanceId}");