Avoid possible null pointer access.

This commit is contained in:
Sönke Ludwig 2021-08-16 18:09:57 +02:00
parent 0f61586438
commit b3b8ff1a43
1 changed files with 4 additions and 1 deletions

View File

@ -209,9 +209,12 @@ final class FormatVisitor : ASTVisitor
override void visit (const FunctionBody functionBody)
{
if (auto bd = functionBody.specifiedFunctionBody)
{
if (bd.blockStatement)
{
astInformation.funBodyLocations ~= bd.blockStatement.startLocation;
}
}
functionBody.accept(this);
}