From 0a854b6ddff6729c4ad88fd8b7f1f36762e2173b Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@cs.uni-duesseldorf.de> Date: Tue, 24 Sep 2019 15:40:09 +0200 Subject: [PATCH] catch null operation in getCustomOperation and provide dialog --- .../ui/operationview/CustomPreconditionInputDialog.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/de.prob.ui/src/de/prob/ui/operationview/CustomPreconditionInputDialog.java b/de.prob.ui/src/de/prob/ui/operationview/CustomPreconditionInputDialog.java index dc587028..5873a5e2 100644 --- a/de.prob.ui/src/de/prob/ui/operationview/CustomPreconditionInputDialog.java +++ b/de.prob.ui/src/de/prob/ui/operationview/CustomPreconditionInputDialog.java @@ -19,6 +19,7 @@ import de.prob.core.command.*; import de.prob.core.domainobjects.Operation; import de.prob.core.domainobjects.OperationInfo; import de.prob.exceptions.ProBException; +import de.prob.logging.Logger; import de.prob.unicode.UnicodeTranslator; public class CustomPreconditionInputDialog extends InputDialog { @@ -72,8 +73,11 @@ public class CustomPreconditionInputDialog extends InputDialog { animator, op.getSource(), Operation.getInternalName(op.getName()), UnicodeTranslator.toUnicode(getValue())); - - ExecuteOperationCommand.executeOperation(animator, customOp); + if (customOp==null) { + Logger.notifyUser("Could not execute the event "+ op.getName() + " with the additional predicate provided!"); + } else { + ExecuteOperationCommand.executeOperation(animator, customOp); + } } catch (ProBException e) { // TODO Auto-generated catch block e.printStackTrace(); -- GitLab