avoid crash if disks are not initialized

This commit is contained in:
Harshavardhana
2020-09-23 12:00:29 -07:00
parent 81caf35926
commit 90cff10e2b
3 changed files with 13 additions and 2 deletions
+5
View File
@@ -50,6 +50,11 @@ func (l *lockRESTServer) writeErrorResponse(w http.ResponseWriter, err error) {
// IsValid - To authenticate and verify the time difference.
func (l *lockRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool {
if l.ll == nil {
l.writeErrorResponse(w, errLockNotInitialized)
return false
}
if err := storageServerRequestValidate(r); err != nil {
l.writeErrorResponse(w, err)
return false