mirror of
https://github.com/ehang-io/nps.git
synced 2025-07-05 06:40:43 +00:00
fix nil pointer
This commit is contained in:
parent
eccf3c2be1
commit
627ea612e6
@ -171,11 +171,11 @@ reset:
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
for {
|
for {
|
||||||
if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil {
|
if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil || resp == nil {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
//if the cache is start and the response is in the extension,store the response to the cache list
|
//if the cache is start and the response is in the extension,store the response to the cache list
|
||||||
if s.useCache && strings.Contains(r.URL.Path, ".") {
|
if s.useCache && r.URL != nil && strings.Contains(r.URL.Path, ".") {
|
||||||
b, err := httputil.DumpResponse(resp, true)
|
b, err := httputil.DumpResponse(resp, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user