mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-12 13:00:38 +00:00
Fix segfault in loadDefinition
for unit tests (#705)
`module` can be empty if the definition file has syntax errors
This commit is contained in:
parent
d6aa35583e
commit
ff736fd3e4
1 changed files with 2 additions and 1 deletions
|
@ -429,7 +429,8 @@ LoadDefinitionFileResult Fixture::loadDefinition(const std::string& source)
|
|||
LoadDefinitionFileResult result = frontend.loadDefinitionFile(source, "@test");
|
||||
freeze(typeChecker.globalTypes);
|
||||
|
||||
dumpErrors(result.module);
|
||||
if (result.module)
|
||||
dumpErrors(result.module);
|
||||
REQUIRE_MESSAGE(result.success, "loadDefinition: unable to load definition file");
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue