add nil/length check when delete old login attempts

(cherry picked from commit e3b3062107)
This commit is contained in:
Marcus Efraimsson
2019-03-19 14:06:06 +01:00
committed by Hugo Häggmark
parent 3ed4d91aee
commit 3a206c5493
+4
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 {