diff --git a/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java b/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java index c86500f..920dd5f 100644 --- a/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java +++ b/src/main/java/edu/kit/typicalc/view/main/MainViewImpl.java @@ -94,6 +94,11 @@ public class MainViewImpl extends AppLayout private void setTermInURL(Pair> lambdaTermAndAssumptions) { String lambdaTerm = lambdaTermAndAssumptions.getLeft(); + if ("".equals(lambdaTerm)) { + UI.getCurrent().getPage().getHistory().pushState(null, new Location("")); + setContent(new StartPageView()); + return; + } StringBuilder types = new StringBuilder(); for (Map.Entry type : lambdaTermAndAssumptions.getRight().entrySet()) { if (types.length() > 0) { diff --git a/src/main/java/edu/kit/typicalc/view/main/UpperBar.java b/src/main/java/edu/kit/typicalc/view/main/UpperBar.java index 71a1bf6..1c32ce2 100644 --- a/src/main/java/edu/kit/typicalc/view/main/UpperBar.java +++ b/src/main/java/edu/kit/typicalc/view/main/UpperBar.java @@ -69,7 +69,9 @@ public class UpperBar extends HorizontalLayout { */ protected void typeInfer(Pair> termAndAssumptions) { setTermInURL.accept(termAndAssumptions); - startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight()); + if (!"".equals(termAndAssumptions.getLeft())) { + startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight()); + } } private void startInfer(String term, Map typeAssumptions) {