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:
chrislusf committed 2026-10-26 01:58:48 -07:00
1 parent 666f80564f
commit f03806064e
1 file changed
+1 -1
+1 -1
View File
@@ -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)