Ensure scope exists

This commit is contained in:
Jaroslav Tulach 2022-07-12 05:43:31 +02:00
parent e9b080030d
commit fc2dca2cfd

View File

@ -482,9 +482,9 @@ public class Context {
ensureModuleIsLoaded(stdDateModuleName);
Optional<Module> dateModule = findModule(stdDateModuleName);
if (dateModule.isPresent()) {
date =
Optional.ofNullable(
dateModule.get().getScope().getConstructors().get(stdDateConstructorName));
final Module m = dateModule.get();
m.ensureScopeExists();
date = Optional.ofNullable(m.getScope().getConstructors().get(stdDateConstructorName));
} else {
date = Optional.empty();
}