Author: adietish
Date: 2010-12-22 14:31:11 -0500 (Wed, 22 Dec 2010)
New Revision: 27693
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
Log:
[JBIDE-7959] added guard to avoid NPE when adding property change listener to current
cloud
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-22 19:22:43
UTC (rev 27692)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-22 19:31:11
UTC (rev 27693)
@@ -1,5 +1,7 @@
2010-12-22 adietisheim <adietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
(addPropertyChangeListener):
+ [JBIDE-7959] added guard to avoid NPE when adding property change listener to current
cloud
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java
(setCPU):
(setMemody):
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2010-12-22
19:22:43 UTC (rev 27692)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2010-12-22
19:31:11 UTC (rev 27693)
@@ -39,7 +39,7 @@
protected ITableContentAndLabelProvider getContentAndLabelProvider() {
return new InstanceViewLabelAndContentProvider();
}
-
+
@Override
protected void refreshToolbarCommandStates() {
IEvaluationService evaluationService = (IEvaluationService)
PlatformUI.getWorkbench().getService(
@@ -49,10 +49,12 @@
evaluationService.requestEvaluation("org.jboss.tools.deltacloud.ui.commands.canReboot");
evaluationService.requestEvaluation("org.jboss.tools.deltacloud.ui.commands.canDestroy");
}
-
+
@Override
protected void addPropertyChangeListener(DeltaCloud cloud) {
- super.addPropertyChangeListener(cloud);
- cloud.addPropertyChangeListener(DeltaCloud.PROP_INSTANCES, this);
+ if (cloud != null) {
+ super.addPropertyChangeListener(cloud);
+ cloud.addPropertyChangeListener(DeltaCloud.PROP_INSTANCES, this);
+ }
}
}
Show replies by date