summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/style.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/style.py b/util/style.py
index 2b9f654d4..498bdf530 100644
--- a/util/style.py
+++ b/util/style.py
@@ -233,6 +233,9 @@ class SortedIncludes(Verifier):
old = ''.join(line + '\n' for line in lines)
f.close()
+ if len(lines) == 0:
+ return 0
+
language = lang_type(filename, lines[0])
sort_lines = list(self.sort_includes(lines, filename, language))
new = ''.join(line + '\n' for line in sort_lines)