Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Tanasenko2015-11-24 11:04:26 +0000
committerAnton Tanasenko2015-11-24 11:04:26 +0000
commit96387f17f91b557a92047e964e5cae31f44a53a3 (patch)
treeeb9d2eb3ddba29314283f04d00d1af5130e4186e /org.eclipse.m2e.jdt
parent8c59225bb26f0086b9ce369e28d24ec0f5d1dcd6 (diff)
downloadm2e-core-96387f17f91b557a92047e964e5cae31f44a53a3.tar.gz
m2e-core-96387f17f91b557a92047e964e5cae31f44a53a3.tar.xz
m2e-core-96387f17f91b557a92047e964e5cae31f44a53a3.zip
fix npes on shutdown
Change-Id: Ib3a518e5b155df3df4b1bd15cf2528acf7c2b153 Signed-off-by: Anton Tanasenko <atg.sleepless@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.jdt')
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
index 2427b352..59cfd023 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
@@ -133,14 +133,22 @@ public class MavenJdtPlugin extends Plugin {
* @noreference see class javadoc
*/
public void stop(BundleContext context) throws Exception {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- MavenProjectManager projectManager = MavenPluginActivator.getDefault().getMavenProjectManager();
- projectManager.removeMavenProjectChangedListener(buildpathManager);
+ super.stop(context);
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
workspace.removeResourceChangeListener(this.buildpathManager);
- DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
- projectManager.removeMavenProjectChangedListener(launchConfigurationListener);
+ MavenPluginActivator mplugin = MavenPluginActivator.getDefault();
+ if(mplugin != null) {
+ MavenProjectManager projectManager = mplugin.getMavenProjectManager();
+ projectManager.removeMavenProjectChangedListener(buildpathManager);
+ projectManager.removeMavenProjectChangedListener(launchConfigurationListener);
+ }
+
+ DebugPlugin dplugin = DebugPlugin.getDefault();
+ if(dplugin != null) {
+ dplugin.getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
+ }
this.buildpathManager = null;
this.launchConfigurationListener = null;

Back to the top