Fix #427 - Crash on invariant

This commit is contained in:
Laurent Tréguier 2019-02-11 11:33:54 +01:00
parent 6b9eddde5d
commit 3e676ba6d1
No known key found for this signature in database
GPG Key ID: 09530BFFC32D4A69
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);
}