From bbf2db0040e55b1a23613bbad2d9ad9627a196d0 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Tue, 7 Jul 2020 21:45:39 +0200 Subject: [PATCH] Tested and fixed some things --- FarmmapsNbs/NbsApplication.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/FarmmapsNbs/NbsApplication.cs b/FarmmapsNbs/NbsApplication.cs index 9e2e525..80e6b73 100644 --- a/FarmmapsNbs/NbsApplication.cs +++ b/FarmmapsNbs/NbsApplication.cs @@ -118,7 +118,12 @@ namespace FarmmapsNbs var uptakeMapItem = await _nitrogenService.CalculateUptakeMap(cropfieldItem, geotiffItem, plantingDate, measurementDate, input.InputVariable); - + if (uptakeMapItem == null) + { + _logger.LogError("Something went wrong with creating the uptakeMap"); + return; + } + _logger.LogInformation("Downloading uptake map"); await _farmmapsApiService.DownloadItemAsync(uptakeMapItem.Code, Path.Combine(DownloadFolder, $"{input.OutputFileName}.uptake.zip")); @@ -129,6 +134,11 @@ namespace FarmmapsNbs measurementDate, input.InputVariable, targetNData.TargetN); + if (applicationMapItem == null) + { + _logger.LogError("Something went wrong with creating the applicationMap"); + return; + } _logger.LogInformation("Downloading application map"); await _farmmapsApiService.DownloadItemAsync(applicationMapItem.Code, Path.Combine(DownloadFolder, $"{input.OutputFileName}.application.zip"));