fix error reset on Select

This commit is contained in:
Andrea Franz 2019-03-15 00:50:06 +01:00
parent 7c52fa75c3
commit bb9353b78a
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
1 changed files with 6 additions and 4 deletions

View File

@ -71,10 +71,12 @@ func (i *Initializer) Info() (*types.ApplicationInfo, error) {
logger.Info("select keycard applet") logger.Info("select keycard applet")
err := cmdSet.Select() err := cmdSet.Select()
if e, ok := err.(*apdu.ErrBadResponse); ok && e.Sw == globalplatform.SwFileNotFound { if err != nil {
err = nil if e, ok := err.(*apdu.ErrBadResponse); ok && e.Sw == globalplatform.SwFileNotFound {
} else { err = nil
logger.Error("select failed", "error", err) } else {
logger.Error("select failed", "error", err)
}
} }
return cmdSet.ApplicationInfo, err return cmdSet.ApplicationInfo, err