aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-01-03 11:29:25 +0100
committerHarald Welte <laforge@gnumonks.org>2019-05-10 17:03:58 +0200
commit5491c48e71e1979f58fff46bc10556b22f458241 (patch)
treeba82e3d7a06b2c5a53ce7c7e66c30165b1d8a5dc
parent89cfded971a1a6b5aa9ee72fb28f8dce93128cf0 (diff)
Don't try to parse result if select_file() failed
-rw-r--r--pySim/commands.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py
index 913f394..3d17903 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -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))