Skip to content

Commit

Permalink
fix NPE when editing imported platform and library (fix #230)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaniel committed May 22, 2019
1 parent 19616b3 commit 29ca458
Showing 1 changed file with 15 additions and 11 deletions.
Expand Up @@ -59,10 +59,12 @@ private List<EObject> getLinkedObjectsForExecutionModel(ExecutionModel context,
String eventProviderName = qualifiedName.getLocalName();
PlatformDefinition platformDefinition = ImportRegistry.getInstance()
.getImportedPlatform((ExecutionModel) context, platformName);
EventProviderDefinition eventProviderDefinition = platformDefinition
.getEventProviderDefinition(eventProviderName);
if (nonNull(eventProviderDefinition)) {
return Arrays.asList(eventProviderDefinition);
if(nonNull(platformDefinition)) {
EventProviderDefinition eventProviderDefinition = platformDefinition
.getEventProviderDefinition(eventProviderName);
if (nonNull(eventProviderDefinition)) {
return Arrays.asList(eventProviderDefinition);
}
}
}
return Collections.emptyList();
Expand Down Expand Up @@ -109,13 +111,15 @@ private List<EObject> getLinkedObjectsForActionInstance(ActionInstance context,
String actionName = qualifiedName.getLocalName();
PlatformDefinition platformDefinition = ImportRegistry.getInstance().getImportedPlatform(executionModel,
platformName);
/*
* Get the first one here, if there are multiple ActionDefinitions with the same name it will be rebound
* when setting its parameters.
*/
ActionDefinition actionDefinition = platformDefinition.getActions(actionName).get(0);
if (nonNull(actionDefinition)) {
return Arrays.asList(actionDefinition);
if(nonNull(platformDefinition)) {
/*
* Get the first one here, if there are multiple ActionDefinitions with the same name it will be rebound
* when setting its parameters.
*/
ActionDefinition actionDefinition = platformDefinition.getActions(actionName).get(0);
if (nonNull(actionDefinition)) {
return Arrays.asList(actionDefinition);
}
}
}
return Collections.emptyList();
Expand Down

0 comments on commit 29ca458

Please sign in to comment.