mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-13 15:29:12 +01:00
volume: guard nil lookup result in proxy path
A master response that omits the requested vid leaves LookupVolumeId returning a nil *LookupResult with a nil error; dereferencing it panics the read handler.
This commit is contained in:
1 parent
666f80564f
commit
f03806064e
1 file changed
+1
-1
@@ -71,7 +71,7 @@ func (vs *VolumeServer) proxyReqToTargetServer(w http.ResponseWriter, r *http.Re
|
||||
InternalError(w, r, nil)
|
||||
return
|
||||
}
|
||||
if err != nil || len(lookupResult.Locations) <= 0 {
|
||||
if err != nil || lookupResult == nil || len(lookupResult.Locations) <= 0 {
|
||||
glog.V(0).Infoln("lookup error:", err, r.URL.Path)
|
||||
stats.VolumeServerFileReadInvalidNeedles.Inc()
|
||||
NotFound(w)
|
||||
|
||||
Reference in new issue
Block a user