Don't try to parse result if select_file() failed

Change-Id: I25b859374e33654e58d07061926bf8529eab87f3
This commit is contained in:
Max 2019-01-03 11:29:25 +01:00 committed by Harald Welte
parent 89cfded971
commit 5491c48e71
1 changed files with 2 additions and 0 deletions

View File

@ -109,6 +109,8 @@ class SimCardCommands(object):
if not hasattr(type(ef), '__iter__'):
ef = [ef]
r = self.select_file(ef)
if len(r[-1]) == 0:
return (None, None)
if length is None:
length = self.__len(r) - offset
pdu = self.cla_byte + 'b0%04x%02x' % (offset, (min(256, length) & 0xff))