From 970381cb1d96f8cc0e7443ff11bdebd35a187525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 17 Sep 2021 20:08:49 +0200 Subject: [PATCH] splitSources.py: Support the case where the input file is empty --- scripts/splitSources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/splitSources.py b/scripts/splitSources.py index bdd53bf0a..3d1c8ef45 100755 --- a/scripts/splitSources.py +++ b/scripts/splitSources.py @@ -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)