Skip to content

Commit 636847b

Browse files
author
Bob Garner
committed
Added fatal log when no default domain is set and it needs to use it.
1 parent a99877b commit 636847b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/entityc/compiler/transform/template/tree/FTTransformSession.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import java.util.Stack;
3535
import java.util.function.Predicate;
3636

37+
import static org.entityc.compiler.transform.template.tree.FTLog.Level.FATAL;
38+
3739
public class FTTransformSession {
3840

3941
private static final List<String> kUnasignable = Arrays.asList("null", "true", "false");
@@ -72,7 +74,11 @@ public FTTransformSession(MTRoot root, MTConfiguration configuration, FTTemplate
7274
addReadonlyNamedValue("space", space);
7375
addReadonlyNamedValue("rootTemplate", templateTransform);
7476
if (template.getDefaultDomainName() != null) {
75-
addReadonlyNamedValue("domain", space.getDomainWithName(template.getDefaultDomainName()));
77+
MTDomain defaultDomain = space.getDomainWithName(template.getDefaultDomainName());
78+
if (defaultDomain == null) {
79+
ECLog.logFatal("Unable to find default name named: " + template.getDefaultDomainName());
80+
}
81+
addReadonlyNamedValue("domain", defaultDomain);
7682
}
7783
setValue("__assert_info", false);
7884
setValue("__assert_debug", false);

0 commit comments

Comments
 (0)