fix nil dereferencing
This commit is contained in:
parent
059bc140ce
commit
e43cb0f06a
|
@ -198,7 +198,7 @@ func (cs *CommandSet) VerifyPIN(pin string) error {
|
||||||
cmd := NewCommandVerifyPIN(pin)
|
cmd := NewCommandVerifyPIN(pin)
|
||||||
resp, err := cs.sc.Send(cmd)
|
resp, err := cs.sc.Send(cmd)
|
||||||
if err = cs.checkOK(resp, err); err != nil {
|
if err = cs.checkOK(resp, err); err != nil {
|
||||||
if resp.Sw&0x63C0 == 0x63C0 {
|
if resp != nil && ((resp.Sw & 0x63C0) == 0x63C0) {
|
||||||
remainingAttempts := resp.Sw & 0x000F
|
remainingAttempts := resp.Sw & 0x000F
|
||||||
return &WrongPINError{
|
return &WrongPINError{
|
||||||
RemainingAttempts: int(remainingAttempts),
|
RemainingAttempts: int(remainingAttempts),
|
||||||
|
@ -220,7 +220,7 @@ func (cs *CommandSet) UnblockPIN(puk string, newPIN string) error {
|
||||||
cmd := NewCommandUnblockPIN(puk, newPIN)
|
cmd := NewCommandUnblockPIN(puk, newPIN)
|
||||||
resp, err := cs.sc.Send(cmd)
|
resp, err := cs.sc.Send(cmd)
|
||||||
if err = cs.checkOK(resp, err); err != nil {
|
if err = cs.checkOK(resp, err); err != nil {
|
||||||
if resp.Sw&0x63C0 == 0x63C0 {
|
if resp != nil && ((resp.Sw & 0x63C0) == 0x63C0) {
|
||||||
remainingAttempts := resp.Sw & 0x000F
|
remainingAttempts := resp.Sw & 0x000F
|
||||||
return &WrongPUKError{
|
return &WrongPUKError{
|
||||||
RemainingAttempts: int(remainingAttempts),
|
RemainingAttempts: int(remainingAttempts),
|
||||||
|
|
Loading…
Reference in New Issue