avoid crash if disks are not initialized

This commit is contained in:
Harshavardhana committed 2020-09-23 12:00:29 -07:00
1 parent 81caf35926
commit 90cff10e2b
3 files changed
+13 -2

No files matched your search

+5
View File
@@ -102,6 +102,11 @@ func storageServerRequestValidate(r *http.Request) error {
// IsValid - To authenticate and verify the time difference.
func (s *storageRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool {
if s.storage == nil {
s.writeErrorResponse(w, errDiskNotFound)
return false
}
if err := storageServerRequestValidate(r); err != nil {
s.writeErrorResponse(w, err)
return false