diff options
Diffstat (limited to 'gopher/gophermap/parse.go')
-rw-r--r-- | gopher/gophermap/parse.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gopher/gophermap/parse.go b/gopher/gophermap/parse.go index 3317514..04286bd 100644 --- a/gopher/gophermap/parse.go +++ b/gopher/gophermap/parse.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io" + "strconv" sr "tildegit.org/tjp/sliderule" "tildegit.org/tjp/sliderule/gopher" @@ -38,6 +39,9 @@ func Parse(input io.Reader) (gopher.MapDocument, error) { item.Selector = string(spl[1]) item.Hostname = string(spl[2]) item.Port = string(spl[3]) + if _, err = strconv.Atoi(item.Port); err != nil { + return nil, InvalidLine(num) + } doc = append(doc, item) } |