check resp != nil before resp.Sw

This commit is contained in:
Andrea Franz 2021-10-22 13:40:56 +02:00
parent 07b455f49c
commit 24b0082888
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ func (cs *CommandSet) Pair(pairingPass string) error {
cmd := NewCommandPairFirstStep(challenge)
resp, err := cs.c.Send(cmd)
if resp.Sw == SwNoAvailablePairingSlots {
if resp != nil && resp.Sw == SwNoAvailablePairingSlots {
return ErrNoAvailablePairingSlots
}