Commit 98b65f66 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Preventing possible null exceptions for calls like 'module.getLocation().xyz()'


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent b0e92f5a
......@@ -537,7 +537,13 @@ pr_TTCN3Module
DocumentComment docComment = getDocumentComment();
}:
( m = pr_TTCN3ModuleKeyword { col = $m.start; }
i = pr_TTCN3ModuleId { act_ttcn3_module = new TTCN3Module( $i.identifier, project ); }
i = pr_TTCN3ModuleId {
act_ttcn3_module = new TTCN3Module( $i.identifier, project );
// Setting a temporary location
// Otherwise, if the post rule codes are not executed, Location of TTCN3Module will be null and
// null exceptions will occur for calls like 'module.getLocation().getFile()'
act_ttcn3_module.setLocation( getLargeLocation( col, getLastVisibleToken() ) );
}
( l = pr_LanguageSpec { languageSpecifications = $l.languageSpec; } )?
begin = pr_BeginChar
pr_ModuleDefinitionsList[null]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment