Change in pysim[master]: Don't try to parse result if select_file() failed

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri May 10 15:08:20 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12462 )

Change subject: Don't try to parse result if select_file() failed
......................................................................

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

Change-Id: I25b859374e33654e58d07061926bf8529eab87f3
---
M pySim/commands.py
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



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 @@
 		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))

-- 
To view, visit https://gerrit.osmocom.org/12462
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I25b859374e33654e58d07061926bf8529eab87f3
Gerrit-Change-Number: 12462
Gerrit-PatchSet: 5
Gerrit-Owner: Max <suraev at alumni.ntnu.no>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Max <suraev at alumni.ntnu.no>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190510/f580d65f/attachment.html>


More information about the gerrit-log mailing list