Merge pull request #15873 from grafana/13344_fix

add nil/length check when delete old login attempts
This commit is contained in:
Marcus Efraimsson 2019-03-08 14:25:24 +01:00 committed by GitHub
commit c9e90f8957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {