Skip to content

Commit

Permalink
Update xml_lib.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bkerler authored Oct 7, 2024
1 parent 7b30c52 commit 127c353
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mtkclient/Library/DA/xml/xml_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,10 @@ def writeflash(self, addr, length, filename, offset=0, parttype=None, wdata=None
self.ack_value(length)
cmd, result = self.get_command_result()
if type(result) is DwnFile:
data = fh.read(length)
if fh:
data = fh.read(length)
else:
data = wdata
if not self.upload(result, data, raw=True):
self.error("Error on writing flash at 0x%08X" % addr)
return False
Expand Down

0 comments on commit 127c353

Please sign in to comment.