aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek Pospychala2012-10-01 05:33:25 (EDT)
committerJacek Pospychala2012-10-01 05:33:25 (EDT)
commit71812a108b5756f14b4456f4e30c772df91776a0 (patch)
tree4c9fceea26e886fae2b93a5aa6d970a09bd7b8ca
parenteffa95cff416204f0152e46a310fc310bc83b291 (diff)
downloadorg.eclipse.pdt-71812a108b5756f14b4456f4e30c772df91776a0.zip
org.eclipse.pdt-71812a108b5756f14b4456f4e30c772df91776a0.tar.gz
org.eclipse.pdt-71812a108b5756f14b4456f4e30c772df91776a0.tar.bz2
error when using the global preferences where no project is available
https://github.com/pulse00/pdt/commit/5cb88058ee8b6482dc7e3cf0f9e40b5bcdec6d43
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPCoreOptionsConfigurationBlock.java32
1 files changed, 18 insertions, 14 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPCoreOptionsConfigurationBlock.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPCoreOptionsConfigurationBlock.java
index 313d2e7..667288e 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPCoreOptionsConfigurationBlock.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPCoreOptionsConfigurationBlock.java
@@ -47,20 +47,24 @@ public abstract class PHPCoreOptionsConfigurationBlock extends
}
protected boolean checkChanges(IScopeContext currContext) {
- final Key versionKey = getPHPCoreKey(Keys.PHP_VERSION);
- // synch the php facets version if needed
- final String newVersion = versionKey.getStoredValue(currContext,
- fManager);
- final IStatus status = PHPFacets.setFacetedVersion(fProject,
- PHPVersion.byAlias(newVersion));
- if (!status.isOK()) {
- MessageDialog dialog = new MessageDialog(
- getShell(),
- PreferencesMessages.PHPCoreOptionsConfigurationBlock_SettingVersionFailed_Title,
- null, status.getMessage(), MessageDialog.ERROR,
- new String[] { IDialogConstants.CANCEL_LABEL }, 0);
- dialog.open();
+ if (fProject != null) {
+ final Key versionKey = getPHPCoreKey(Keys.PHP_VERSION);
+ // synch the php facets version if needed
+ final String newVersion = versionKey.getStoredValue(currContext,
+ fManager);
+ final IStatus status = PHPFacets.setFacetedVersion(fProject,
+ PHPVersion.byAlias(newVersion));
+ if (!status.isOK()) {
+ MessageDialog dialog = new MessageDialog(
+ getShell(),
+ PreferencesMessages.PHPCoreOptionsConfigurationBlock_SettingVersionFailed_Title,
+ null, status.getMessage(), MessageDialog.ERROR,
+ new String[] { IDialogConstants.CANCEL_LABEL }, 0);
+ dialog.open();
+ }
+ return status.isOK();
}
- return status.isOK();
+
+ return super.checkChanges(currContext);
}
}