Fix #427 - Crash on invariant (#428)

Fix #427 - Crash on invariant
merged-on-behalf-of: Basile-z <Basile-z@users.noreply.github.com>
This commit is contained in:
Laurent Tréguier 2019-02-11 13:55:33 +01:00 committed by The Dlang Bot
parent 6b9eddde5d
commit dae7d85c80
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}