Fixes #240 - IndexError: list index out of range

Thanks to https://github.com/gusc (Gusts Kaksis) for the patch.
This commit is contained in:
Shazron Abdullah 2016-09-14 02:11:52 -07:00
parent d7cccae1ad
commit feb51d582a

View File

@ -32,7 +32,10 @@ def run_command(debugger, command, result, internal_dict):
args = command.split('--',1)
error = lldb.SBError()
lldb.target.modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))
lldb.target.Launch(lldb.SBLaunchInfo(shlex.split(args[1] and args[1] or '{args}')), error)
args_arr = []
if len(args) > 1:
args_arr = shlex.split(args[1] and args[1] or '{args}')
lldb.target.Launch(lldb.SBLaunchInfo(args_arr), error)
lockedstr = ': Locked'
if lockedstr in str(error):
print('\\nDevice Locked\\n')