mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08: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
@ -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 New Issue
Block a user