From 20e7a43801d207f3148b84f6453867fb1fc20d8f Mon Sep 17 00:00:00 2001 From: JULLIEN Baptiste Date: Sat, 27 Apr 2024 10:15:46 +0200 Subject: [PATCH] Fix server panic error in connectCard --- backend/internal/models/account.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/internal/models/account.go b/backend/internal/models/account.go index 13f93e1..73abbbd 100644 --- a/backend/internal/models/account.go +++ b/backend/internal/models/account.go @@ -32,8 +32,11 @@ func (o *Account) VerifyPin(pwd string) bool { } func (o *Account) VerifyPassword(pwd string) bool { - ok, _ := hash.Verify(*o.Account.Password, pwd) + if (o.Account.Password != nil) { + ok, _ := hash.Verify(*o.Account.Password, pwd) return ok + } + return false } func (o *Account) IsAdmin() bool {