aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek Pospychala2012-08-03 03:35:43 (EDT)
committerJacek Pospychala2012-08-03 03:35:43 (EDT)
commitd0cc7dad7053200be6751aef887b0c0abdc6a4cd (patch)
treee2729ed9a97c5b947a92d117668d4fa959f3878f
parent62397116961a3cbf3a83f1407db3397abff3348c (diff)
downloadorg.eclipse.pdt-d0cc7dad7053200be6751aef887b0c0abdc6a4cd.zip
org.eclipse.pdt-d0cc7dad7053200be6751aef887b0c0abdc6a4cd.tar.gz
org.eclipse.pdt-d0cc7dad7053200be6751aef887b0c0abdc6a4cd.tar.bz2
Bug 386537 - Tests failing due to NullPointerException
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
index 6b94a4b..a1d6cd2 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
@@ -1286,13 +1286,18 @@ public class PHPStructuredEditor extends StructuredTextEditor implements
if (getSelectionProvider() instanceof IPostSelectionProvider) {
IPostSelectionProvider psp = (IPostSelectionProvider) getSelectionProvider();
- IAction action = getAction(IPHPEditorActionDefinitionIds.OPEN_TYPE_HIERARCHY);
- if (action instanceof ISelectionChangedListener) {
- psp.removePostSelectionChangedListener((ISelectionChangedListener) action);
- }
- action = getAction(IPHPEditorActionDefinitionIds.OPEN_CALL_HIERARCHY);
- if (action instanceof ISelectionChangedListener) {
- psp.removePostSelectionChangedListener((ISelectionChangedListener) action);
+ try {
+ IAction action = getAction(IPHPEditorActionDefinitionIds.OPEN_TYPE_HIERARCHY);
+ if (action instanceof ISelectionChangedListener) {
+ psp.removePostSelectionChangedListener((ISelectionChangedListener) action);
+ }
+ action = getAction(IPHPEditorActionDefinitionIds.OPEN_CALL_HIERARCHY);
+ if (action instanceof ISelectionChangedListener) {
+ psp.removePostSelectionChangedListener((ISelectionChangedListener) action);
+ }
+ } catch (NullPointerException ex) {
+ // NPE thrown by getAction in case when class has already been
+ // disposed but dispose is called again.
}
}