common: fix potential panic case

This commit is contained in:
Mitchell Hashimoto 2015-06-21 19:58:18 -07:00
parent 9c6d0dfc8b
commit 897888fde3
1 changed files with 1 additions and 1 deletions

View File

@ -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 {