From 86fbd3973817cd68fae5a0f32a183c7cd1e8565d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 2 Apr 2021 22:13:09 +0200 Subject: [PATCH] filesystem: Fix interpret_sw() fall-through if an application-specific interpret_sw() fails, fall back to the profile interpret_sw(). Change-Id: I326c6002c75e2f906848784b7831ea169134dbe4 --- pySim/filesystem.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 9a68d5a4..55a71303 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -875,6 +875,7 @@ class RuntimeState(object): Returns: Tuple of two strings """ + res = None adf = self.get_application_df() if adf: app = adf.application @@ -882,11 +883,8 @@ class RuntimeState(object): # method or we will use the interpret_sw method from the # card profile. if app and hasattr(app, "interpret_sw"): - return app.interpret_sw(sw) - else: - return self.profile.interpret_sw(sw) - else: - return self.profile.interpret_sw(sw) + res = app.interpret_sw(sw) + return res or self.profile.interpret_sw(sw) def probe_file(self, fid:str, cmd_app=None): """Blindly try to select a file and automatically add a matching file