diff --git a/src/dfmt/ast_info.d b/src/dfmt/ast_info.d index c5bd3cc..9c3f68f 100644 --- a/src/dfmt/ast_info.d +++ b/src/dfmt/ast_info.d @@ -292,7 +292,9 @@ final class FormatVisitor : ASTVisitor override void visit(const Invariant invariant_) { - astInformation.doubleNewlineLocations ~= invariant_.blockStatement.endLocation; + if (invariant_.blockStatement !is null) + astInformation.doubleNewlineLocations ~= invariant_.blockStatement.endLocation; + invariant_.accept(this); }