[Esbox-commits] r2100 - branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard

eswartz at garage.maemo.org eswartz at garage.maemo.org
Thu Sep 3 22:24:12 EEST 2009


Author: eswartz
Date: 2009-09-03 22:24:10 +0300 (Thu, 03 Sep 2009)
New Revision: 2100

Modified:
   branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerSelectionWizardPage.java
Log:
Fix class cast exception caused by viewing dropdown before refresh complete

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerSelectionWizardPage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerSelectionWizardPage.java	2009-09-03 19:22:33 UTC (rev 2099)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerSelectionWizardPage.java	2009-09-03 19:24:10 UTC (rev 2100)
@@ -175,10 +175,13 @@
 		sboxCombo.addSelectionChangedListener(new ISelectionChangedListener() {
 
 			public void selectionChanged(SelectionChangedEvent event) {
-				sdk = ((IScratchbox1SDK) ((IStructuredSelection) event.getSelection()).getFirstElement());
-				if (targetInstallerData != null && sdk != null)
-					targetInstallerData.setScratchbox1SDK(sdk);
-				validatePage();
+				Object firstElement = ((IStructuredSelection) event.getSelection()).getFirstElement();
+				if (firstElement instanceof IScratchbox1SDK) {
+					sdk = ((IScratchbox1SDK) firstElement);
+					if (targetInstallerData != null && sdk != null)
+						targetInstallerData.setScratchbox1SDK(sdk);
+					validatePage();
+				}
 			}
 			
 		});



More information about the Esbox-commits mailing list