Mercurial > gemma
comparison 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 |
comparison
equal
deleted
inserted
replaced
3519:a6128caca3c1 | 3528:b9e331c1e616 |
---|---|
18 "context" | 18 "context" |
19 "database/sql" | 19 "database/sql" |
20 "errors" | 20 "errors" |
21 "regexp" | 21 "regexp" |
22 "strconv" | 22 "strconv" |
23 "strings" | |
23 "time" | 24 "time" |
24 | 25 |
25 "gemma.intevation.de/gemma/pkg/soap/ifbn" | 26 "gemma.intevation.de/gemma/pkg/soap/ifbn" |
26 ) | 27 ) |
27 | 28 |
266 } | 267 } |
267 | 268 |
268 rb, lb := splitRBLB(bn.Rb_lb) | 269 rb, lb := splitRBLB(bn.Rb_lb) |
269 | 270 |
270 var revisitingTime *int | 271 var revisitingTime *int |
271 if bn.Revisiting_time != nil { | 272 if bn.Revisiting_time != nil && |
273 len(strings.TrimSpace(*bn.Revisiting_time)) > 0 { | |
272 i, err := strconv.Atoi(*bn.Revisiting_time) | 274 i, err := strconv.Atoi(*bn.Revisiting_time) |
273 if err != nil { | 275 if err != nil { |
274 feedback.Warn("Cannot convert '%s' to number of months", | 276 feedback.Warn("Cannot convert '%s' to number of months", |
275 *bn.Revisiting_time) | 277 *bn.Revisiting_time) |
276 } else { | 278 } else { |