changeset 4699:8b6ffd9d0b18

Fixed crash: handle case when no LDC is available.
author Sascha Wilde <wilde@intevation.de>
date Wed, 16 Oct 2019 16:49:03 +0200
parents ce55f15e25e0
children a0c320d89682
files pkg/controllers/stretches.go
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/stretches.go	Wed Oct 16 16:40:08 2019 +0200
+++ b/pkg/controllers/stretches.go	Wed Oct 16 16:49:03 2019 +0200
@@ -100,6 +100,10 @@
 		return nil, err
 	}
 
+	if len(ldc) == 0 {
+		return nil, fmt.Errorf("No LDC found for bottleneck: %s", bn.name)
+	}
+
 	var access func(*availMeasurement) float64
 	var breaks []float64