From b2ffd9b17391745ed6f08ed32dc50f9ec5f564b6 Mon Sep 17 00:00:00 2001 From: MarkS Date: Mon, 14 Sep 2026 16:42:49 -0600 Subject: [PATCH] Remove a couple null-forgiving operators in MachineApiService --- src/SIL.XForge.Scripture/Services/MachineApiService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SIL.XForge.Scripture/Services/MachineApiService.cs b/src/SIL.XForge.Scripture/Services/MachineApiService.cs index 646476d46d3..e31ff16c32c 100644 --- a/src/SIL.XForge.Scripture/Services/MachineApiService.cs +++ b/src/SIL.XForge.Scripture/Services/MachineApiService.cs @@ -1529,10 +1529,9 @@ CancellationToken cancellationToken if ( buildProjectEvent?.Payload?.TryGetValue("buildConfig", out BsonValue? buildConfigBson) == true && buildConfigBson != null + && JsonConvert.DeserializeObject(buildConfigBson.ToJson()) is { } buildConfig ) { - BuildConfig buildConfig = JsonConvert.DeserializeObject(buildConfigBson.ToJson())!; - // Look up project snapshots for any referenced project IDs not already cached HashSet referencedProjectIds = [ @@ -3453,7 +3452,7 @@ out SFProjectSecret? projectSecret } // Get the parallel corpus id - string? parallelCorpusId = projectSecret.ServalData!.ParallelCorpusIdForPreTranslate; + string? parallelCorpusId = projectSecret.ServalData?.ParallelCorpusIdForPreTranslate; if (string.IsNullOrWhiteSpace(parallelCorpusId)) { throw new DataNotFoundException("The parallel corpus ID cannot be found.");