From 8517a28b5755550c28d1bf2c42e6b14e63d2eba9 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Thu, 12 Dec 2024 15:11:48 +0100 Subject: [PATCH] Show corret message if layer is missing --- Geodatenbezug/Processors/TopicProcessor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Geodatenbezug/Processors/TopicProcessor.cs b/Geodatenbezug/Processors/TopicProcessor.cs index 64510ba..d70d4e1 100644 --- a/Geodatenbezug/Processors/TopicProcessor.cs +++ b/Geodatenbezug/Processors/TopicProcessor.cs @@ -223,6 +223,10 @@ public GdalLayer CreateGdalLayer(string layerName, Dictionary { var inputLayer = InputDataSource.GetLayerByName(layerName); + if (inputLayer == null) { + throw new InvalidOperationException($"Layer {layerName} not found in input data source"); + } + // Workaround https://github.com/blw-ofag-ufag/geodatenbezug_geodienste/issues/45 var geometryType = inputLayer.GetNextFeature().GetGeometryRef().GetGeometryType();