diff --git a/pySim/cards.py b/pySim/cards.py index a341b717..cb42d83f 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']))