diff pkg/imports/bn.go @ 3528:b9e331c1e616

Ignore zero length and whitespace-only values
author Tom Gottfried <tom@intevation.de>
date Wed, 29 May 2019 16:00:28 +0200
parents 6592396f5061
children e98ea184538e
line wrap: on
line diff
--- a/pkg/imports/bn.go	Wed May 29 12:04:19 2019 +0200
+++ b/pkg/imports/bn.go	Wed May 29 16:00:28 2019 +0200
@@ -20,6 +20,7 @@
 	"errors"
 	"regexp"
 	"strconv"
+	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/soap/ifbn"
@@ -268,7 +269,8 @@
 	rb, lb := splitRBLB(bn.Rb_lb)
 
 	var revisitingTime *int
-	if bn.Revisiting_time != nil {
+	if bn.Revisiting_time != nil &&
+		len(strings.TrimSpace(*bn.Revisiting_time)) > 0 {
 		i, err := strconv.Atoi(*bn.Revisiting_time)
 		if err != nil {
 			feedback.Warn("Cannot convert '%s' to number of months",