Commit 69f49e1c authored by Egon Elbre's avatar Egon Elbre Committed by Brad Fitzpatrick

cmd/pprof: fix crash with invalid source

pprof crashed when running with:

     go tool pprof %INVALID

Change-Id: I47c2a4da7273e3a97a833f320a650b8c6b59d6b9
Reviewed-on: https://go-review.googlesource.com/20632Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent af1c29c1
......@@ -139,7 +139,7 @@ func adjustURL(source string, sec int, ui plugin.UI) (adjusted, host string, dur
if err != nil || (url.Host == "" && url.Scheme != "" && url.Scheme != "file") {
url, err = url.Parse("http://" + source)
if err != nil {
return source, url.Host, time.Duration(30) * time.Second
return source, "", 0
}
}
if scheme := strings.ToLower(url.Scheme); scheme == "" || scheme == "file" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment