From 8444784221f3c8724f6116820792802d1ca80e7c Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 30 Jan 2020 19:41:55 -0800 Subject: [PATCH 1/2] Fixes bug that causes crash on broken gophermaps --- VERSION | 2 +- gopher/gopher.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 7ec1d6d..eca07e4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 +2.1.2 diff --git a/gopher/gopher.go b/gopher/gopher.go index fd5744f..eec64b6 100644 --- a/gopher/gopher.go +++ b/gopher/gopher.go @@ -133,11 +133,12 @@ func parseMap(text string) (string, []string) { title = line[0][1:] } else { title = "" + line[0] = "i " } - if len(line) > 1 && len(line[0]) > 0 && string(line[0][0]) == "i" { + if len(line) < 4 || strings.HasPrefix(line[0], "i") { splitContent[i] = " " + string(title) - } else if len(line) >= 4 { + } else { link := buildLink(line[2], line[3], string(line[0][0]), line[1]) links = append(links, link) linktext := fmt.Sprintf("(%s) %2d %s", getType(string(line[0][0])), len(links), title) From 9e68f383a0b51611e4fcbbc67e5da475016b3105 Mon Sep 17 00:00:00 2001 From: sloum Date: Thu, 30 Jan 2020 19:42:45 -0800 Subject: [PATCH 2/2] Updates version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index eca07e4..ac2cdeb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.2 +2.1.3