Skip to content

Commit 512a630

Browse files
BeckerWdfmickaelistria
authored andcommitted
Fix NPE when changing Eclipse theme
Fixes eclipse-platform#60
1 parent 8ca5a4f commit 512a630

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.eclipse.swt.widgets.Button;
6969
import org.eclipse.swt.widgets.Composite;
7070
import org.eclipse.swt.widgets.Control;
71+
import org.eclipse.swt.widgets.Display;
7172
import org.eclipse.swt.widgets.Label;
7273
import org.eclipse.ui.IWorkbench;
7374
import org.eclipse.ui.IWorkbenchPreferenceConstants;
@@ -241,7 +242,6 @@ protected void createEnableMruPref(Composite composite) {
241242
enableMru = createCheckButton(composite, WorkbenchMessages.ViewsPreference_enableMRU, actualValue);
242243
}
243244

244-
245245
/** @return the currently selected theme or null if there are no themes */
246246
private ITheme getSelectedTheme() {
247247
return (ITheme) (themeIdCombo.getStructuredSelection().getFirstElement());
@@ -314,11 +314,10 @@ public boolean performOk() {
314314
*/
315315
private void showRestartDialog() {
316316
if (new MessageDialog(null, WorkbenchMessages.ThemeChangeWarningTitle, null,
317-
WorkbenchMessages.ThemeChangeWarningText,
318-
MessageDialog.QUESTION, 2, WorkbenchMessages.Workbench_RestartButton,
319-
WorkbenchMessages.Workbench_DontRestartButton)
317+
WorkbenchMessages.ThemeChangeWarningText, MessageDialog.QUESTION, 2,
318+
WorkbenchMessages.Workbench_RestartButton, WorkbenchMessages.Workbench_DontRestartButton)
320319
.open() == Window.OK) {
321-
PlatformUI.getWorkbench().restart();
320+
Display.getDefault().asyncExec(() -> PlatformUI.getWorkbench().restart());
322321
}
323322
}
324323

0 commit comments

Comments
 (0)