Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2016-02-03 14:51:50 +0000
committerCamille Letavernier2016-02-03 14:51:50 +0000
commit70b72ba9943c839aec0a04caae4312cea8e240f0 (patch)
tree2412e59542fc9cb9e557f06179c3780bf48e66b5
parent193569eabef50692dddb345c5080d0a6b6b80b32 (diff)
downloadorg.eclipse.papyrus-70b72ba9943c839aec0a04caae4312cea8e240f0.tar.gz
org.eclipse.papyrus-70b72ba9943c839aec0a04caae4312cea8e240f0.tar.xz
org.eclipse.papyrus-70b72ba9943c839aec0a04caae4312cea8e240f0.zip
Bug 487098: [ServiceUtils] NPE when closing Papyrus
https://bugs.eclipse.org/bugs/show_bug.cgi?id=487098 Change-Id: I191dc51f9a33a164c69f42e0261af595963f7ab1 Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
-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