From fc2dca2cfdb415d7edd713526bb427c78a9a9eed Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Tue, 12 Jul 2022 05:43:31 +0200 Subject: [PATCH] Ensure scope exists --- .../src/main/java/org/enso/interpreter/runtime/Context.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java index b02cb9322df0..862a677bfde6 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java @@ -482,9 +482,9 @@ public Optional getDateConstructor() { ensureModuleIsLoaded(stdDateModuleName); Optional 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(); }