From 897888fde3d12d9ea627a423714f4296c49826db Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 21 Jun 2015 19:58:18 -0700 Subject: [PATCH] common: fix potential panic case --- common/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/download.go b/common/download.go index b5798b76c..c9d0bf11d 100644 --- a/common/download.go +++ b/common/download.go @@ -118,7 +118,7 @@ func (d *DownloadClient) Get() (string, error) { finalPath = url.Path // Remove forward slash on absolute Windows file URLs before processing - if runtime.GOOS == "windows" && finalPath[0] == '/' { + if runtime.GOOS == "windows" && len(finalPath) > 0 && finalPath[0] == '/' { finalPath = finalPath[1:len(finalPath)] } } else {