Skip to content

Commit e2af46c

Browse files
ewillinkmerks
authored andcommitted
[#80] Avoid unnecessary standalone NPE
1 parent 71d1a05 commit e2af46c

File tree

1 file changed

+7
-4
lines changed
  • plugins/org.eclipse.emf.common/src/org/eclipse/emf/common

1 file changed

+7
-4
lines changed

plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/EMFPlugin.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ public abstract class EMFPlugin extends DelegatingResourceLocator implements Res
8282
boolean result = false;
8383
try
8484
{
85-
// With this we make sure, that we are really in a proper Eclipse Environment with everything we need.
86-
// Some supplements pretend that the Platform is running, but don't provide a ExtensionRegistry.
87-
FrameworkUtil.getBundle(EMFPlugin.class).loadClass("org.eclipse.core.runtime.IRegistryChangeListener");
88-
result = Platform.isRunning();
85+
if (Platform.isRunning())
86+
{
87+
// With this we make sure, that we are really in a proper Eclipse Environment with everything we need.
88+
// Some supplements pretend that the Platform is running, but don't provide a ExtensionRegistry.
89+
FrameworkUtil.getBundle(EMFPlugin.class).loadClass("org.eclipse.core.runtime.IRegistryChangeListener");
90+
result = true;
91+
}
8992
}
9093
catch (Throwable exception)
9194
{

0 commit comments

Comments
 (0)