소스 검색

Merge pull request #15873 from grafana/13344_fix

add nil/length check when delete old login attempts
Marcus Efraimsson 6 년 전
부모
커밋
c9e90f8957
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      pkg/services/sqlstore/login_attempt.go

+ 4 - 0
pkg/services/sqlstore/login_attempt.go

@@ -44,6 +44,10 @@ func DeleteOldLoginAttempts(cmd *m.DeleteOldLoginAttemptsCommand) error {
 			return err
 		}
 
+		if result == nil || len(result) == 0 || result[0] == nil {
+			return nil
+		}
+
 		maxId = toInt64(result[0]["id"])
 
 		if maxId == 0 {