Skip to content

Commit f21609c

Browse files
committed
[GTK] Fix NPE in switch page on gtk 4.x
Added missing null/disposal check for cases when tab has no control set. Issue can be seen and verified fixed using Snippet266.
1 parent a413b4b commit f21609c

File tree

1 file changed

+4
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+4
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,10 @@ long gtk_switch_page(long notebook, long page, int page_num) {
589589

590590
if (GTK.GTK4) {
591591
Control control = item.getControl();
592-
control.setBoundsInPixels(getClientAreaInPixels());
592+
if (control != null && !control.isDisposed()) {
593+
control.setBoundsInPixels(getClientAreaInPixels());
594+
control.setVisible(true);
595+
}
593596
} else {
594597
int index = GTK.gtk_notebook_get_current_page(handle);
595598
if (index != -1) {

0 commit comments

Comments
 (0)