Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/ServiceUtils.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/ServiceUtils.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/ServiceUtils.java
index 4c6cf904a7c..4ee47baabbd 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/ServiceUtils.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/ServiceUtils.java
@@ -44,7 +44,14 @@ public class ServiceUtils extends AbstractServiceUtils<ServicesRegistry> {
*/
@Override
public ServicesRegistry getServiceRegistry(ServicesRegistry from) throws ServiceException {
- return (from != null) ? from : getContextualServiceRegistry();
+ if (from != null) {
+ return from;
+ }
+ ServicesRegistry contextual = getContextualServiceRegistry();
+ if (contextual == null) {
+ throw new ServiceException("The Service Registry could not be found");
+ }
+ return contextual;
}
}

Back to the top