Skip to content

Commit 1a43fc1

Browse files
azoitlvogella
authored andcommitted
MultipageEditorPart check for tab disposal when getting Editor
Getting an editor of a MultpageEditorPart during disposal of the editor led to dispose exceptions as getEditor is accessing an Item's data without checking for disposal. This happened for example when during shutdown the Web-kit widget is sending SWT events. (see eclipse-4diac/4diac-ide#1808 for details). By checking for disposal of the item. This issue is prevent.
1 parent 02dabfc commit 1a43fc1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/part/MultiPageEditorPart.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2019 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -648,11 +648,8 @@ protected Control getControl(int pageIndex) {
648648
*/
649649
protected IEditorPart getEditor(int pageIndex) {
650650
Item item = getItem(pageIndex);
651-
if (item != null) {
652-
Object data = item.getData();
653-
if (data instanceof IEditorPart) {
654-
return (IEditorPart) data;
655-
}
651+
if (item != null && !item.isDisposed() && item.getData() instanceof IEditorPart ep) {
652+
return ep;
656653
}
657654
return null;
658655
}

0 commit comments

Comments
 (0)