Stop wmlparser from crashing on empty files.
This commit is contained in:
parent
09e8a90d44
commit
c2fb5a09f2
1 changed files with 2 additions and 1 deletions
|
@ -102,7 +102,8 @@ class Parser:
|
|||
u = text.decode("latin1")
|
||||
text = u
|
||||
text = text.replace("\r\n", "\n").replace("\t", " ").replace("\r", "\n")
|
||||
if text[-1] != "\n": text += "\n"
|
||||
if text == "" or text[-1] != "\n":
|
||||
text += "\n"
|
||||
return text
|
||||
|
||||
def set_macro_not_found_callback(self, callback):
|
||||
|
|
Loading…
Add table
Reference in a new issue