Skip to content
Snippets Groups Projects
Commit e165ad92 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

guard for some corner case

refs 2553
parent 8db52c85
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 8BAACE2F49DCFCAFA68F0D0AC25800DB
* @ConQAT.Rating YELLOW Hash: 096D8BEE83E5787D24BD8EC4407E4FD4
*/
public class ConstraintMenu implements IContextMenuContributor {
......@@ -99,7 +99,7 @@ public class ConstraintMenu implements IContextMenuContributor {
};
return new ActionContributionItem(a);
}
if(m.getItems().length == 1) {
if(m.getItems().length == 1 && m.getTopActionContribution() != null) {
IAction uniqueAction = m.getTopActionContribution().getAction();
String txt = m.getMenuText();
String newText = txt + " -> " + uniqueAction.getText();
......@@ -203,7 +203,10 @@ public class ConstraintMenu implements IContextMenuContributor {
* contribution and we therefore want to present it without going through a submenu.
*/
public ActionContributionItem getTopActionContribution() {
return moreInfoAction;
if(this.getItems()[0] instanceof ActionContributionItem) {
return (ActionContributionItem)this.getItems()[0];
}
return null;
}
/** Action to update a constraint. Assumes the status *can be open*. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment