Skip to content

Commit 9644c6b

Browse files
authored
Merge pull request #53 from JeffLIrion/screencap-fix
Check the length of the screencap before indexing into it
2 parents 98db67e + 26620e1 commit 9644c6b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ppadb/command/transport/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def screencap(self):
4545
conn.send(cmd)
4646
result = conn.read_all()
4747

48-
if result[5] == 0x0d:
48+
if result and len(result) > 5 and result[5] == 0x0d:
4949
return result.replace(b'\r\n', b'\n')
5050
else:
5151
return result

0 commit comments

Comments
 (0)