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}");