Author: scabanovich
Date: 2011-08-26 21:26:49 -0400 (Fri, 26 Aug 2011)
New Revision: 34351
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
Log:
WebKbPlugin.getDefault() can return null if plugin is stopped. Setting singleton instance
of plugin to null at stopping is a common practice in Eclipse.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-08-27
01:10:10 UTC (rev 34350)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-08-27
01:26:49 UTC (rev 34351)
@@ -432,10 +432,14 @@
*/
private File getStorageFile() {
WebKbPlugin plugin = WebKbPlugin.getDefault();
- //The plug-in instance can be null at shutdown, when the plug-in is stopped.
- IPath path = plugin.getStateLocation();
- File file = new File(path.toFile(), "projects/" + project.getName() +
".xml"); //$NON-NLS-1$ //$NON-NLS-2$
- return file;
+ if( plugin != null) {
+ //The plug-in instance can be null at shutdown, when the plug-in is stopped.
+ IPath path = plugin.getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName() +
".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ return file;
+ } else {
+ return null;
+ }
}
public void clearStorage() {
Show replies by date