Blob Blame History Raw
From 46ffc3b6ab3b1e70a8f681353bd9a549dfd13bc9 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Fri, 15 Mar 2019 11:48:04 +0000
Subject: [PATCH] Fix widget is disposed error on platform start up

---
 .../internal/mpc/ui/wizards/MarketplaceDropAdapter.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/wizards/MarketplaceDropAdapter.java b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/wizards/MarketplaceDropAdapter.java
index e594b65..244e5ec 100644
--- a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/wizards/MarketplaceDropAdapter.java
+++ b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/wizards/MarketplaceDropAdapter.java
@@ -133,9 +133,11 @@ public class MarketplaceDropAdapter implements IStartup {
 			Composite composite = (Composite) child;
 			// Bug 485245 - avoid UI freezes for deeply nested widget trees
 			composite.getDisplay().asyncExec(() -> {
-				Control[] children = composite.getChildren();
-				for (Control control : children) {
-					hookRecursive(control, dropListener);
+				if (!composite.isDisposed()) {
+					Control[] children = composite.getChildren();
+					for (Control control : children) {
+						hookRecursive(control, dropListener);
+					}
 				}
 			});
 		}
-- 
2.20.1