splitSources.py: Support the case where the input file is empty

This commit is contained in:
Kamil Śliwak
2021-09-27 13:17:13 +02:00
parent a67828b9ba
commit 970381cb1d
+1 -1
View File
@@ -65,7 +65,7 @@ if __name__ == '__main__':
# decide if file has multiple sources
with open(filePath, mode='r', encoding='utf8', newline='') as f:
lines = f.read().splitlines()
if lines[0][:12] == "==== Source:":
if len(lines) >= 1 and lines[0][:12] == "==== Source:":
hasMultipleSources = True
writeSourceToFile(lines)