aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pySim/cards.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index a341b71..cb42d83 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -582,9 +582,9 @@ class SysmoUSIMSJS1(Card):
data, sw = self._scc.update_binary('00FF', p['ki'])
# set OPc in proprietary file
- content = "01" + p['opc']
- data, sw = self._scc.update_binary('00F7', content)
-
+ if 'opc' in p:
+ content = "01" + p['opc']
+ data, sw = self._scc.update_binary('00F7', content)
# write EF.IMSI
data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi']))