Skip to content

Commit 7d677bf

Browse files
authored
Merge pull request swiftlang#160 from ddunbar/missing-root-document
[BuildSystem] Error if there is no root document.
2 parents b1f8505 + cc34966 commit 7d677bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/BuildSystem/BuildFile.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,13 @@ class BuildFileImpl {
853853
}
854854

855855
auto& document = *it;
856-
if (!parseRootNode(document.getRoot())) {
856+
auto root = document.getRoot();
857+
if (!root) {
858+
error("missing document in stream");
859+
return nullptr;
860+
}
861+
862+
if (!parseRootNode(root)) {
857863
return nullptr;
858864
}
859865

0 commit comments

Comments
 (0)