From 8d7ff22fed20c56bfe2bb8f118cc03b7cfe722ae Mon Sep 17 00:00:00 2001 From: Peter Dyer Date: Sun, 5 Aug 2018 00:25:27 +0100 Subject: [PATCH] Fix panic on invalid version strings --- dep.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dep.go b/dep.go index 3328331f..47c8c0a5 100644 --- a/dep.go +++ b/dep.go @@ -53,6 +53,10 @@ func splitDep(dep string) (string, string, string) { return match }) + if len(split) == 0 { + return "", "", "" + } + if len(split) == 1 { return split[0], "", "" }