aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2012-07-17 05:02:47 (EDT)
committerMickael Istria2012-07-17 10:28:47 (EDT)
commiteb179688978e54f2eacbcd71426869551d369008 (patch)
tree455dc5289381939ae1111c18f3e30fa7cfb374e6
parentbf7b0ad19912b8b21c9781c68e57aac14d14b55f (diff)
downloadorg.eclipse.swtbot-eb179688978e54f2eacbcd71426869551d369008.zip
org.eclipse.swtbot-eb179688978e54f2eacbcd71426869551d369008.tar.gz
org.eclipse.swtbot-eb179688978e54f2eacbcd71426869551d369008.tar.bz2
Bug 385220 - SWTBotFactory.shells() should guard against closing shells
-rw-r--r--org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
index ac2dc20..f7d3dab 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/SWTBotFactory.java
@@ -326,7 +326,16 @@ abstract class SWTBotFactory {
Shell[] shells = finder.getShells();
ArrayList<SWTBotShell> result = new ArrayList<SWTBotShell>();
for (Shell shell : shells) {
- result.add(new SWTBotShell(shell));
+ try {
+ result.add(new SWTBotShell(shell));
+ }
+ catch (WidgetNotFoundException exc) {
+ // Bug 385220
+ // If we were called while a shell was closing, a shell we
+ // got from finder.getShells() above could have been disposed
+ // by now. Simply ignore it
+ }
+
}
return result.toArray(new SWTBotShell[] {});
}