connector: check for nil on cancel

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-09-10 13:02:30 -06:00
parent 3f69f29d49
commit 3acd95741f
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -34,7 +34,9 @@ type PhoneLogin struct {
var _ bridgev2.LoginProcessUserInput = (*PhoneLogin)(nil)
func (p *PhoneLogin) Cancel() {
p.authClientCancel()
if p.authClientCancel != nil {
p.authClientCancel()
}
}
func (p *PhoneLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) {
+3 -1
View File
@@ -40,7 +40,9 @@ var _ bridgev2.LoginProcessDisplayAndWait = (*QRLogin)(nil) // For showing QR co
var _ bridgev2.LoginProcessUserInput = (*QRLogin)(nil) // For asking for password
func (q *QRLogin) Cancel() {
q.authClientCancel()
if q.authClientCancel != nil {
q.authClientCancel()
}
}
func (q *QRLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) {