From 0ec7402a8ec99f10162f3a336aaa8ef5919a1712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kubitz?= Date: Tue, 8 Oct 2024 10:32:04 +0200 Subject: [PATCH] fix NPE in CTabFolder.onPaint #1515 was reproduceable with StackRendererTest.testOnboardingIsHiddenWhenEditorOpened() https://github.com/eclipse-platform/eclipse.platform.swt/issues/1515 --- .../common/org/eclipse/swt/custom/CTabFolder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java index 4d29c190884..23078ba5eb3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java @@ -2062,6 +2062,9 @@ void onPaint(Event event) { } GC gc = event.gc; + if (gc == null) { + return; + } Font gcFont = gc.getFont(); Color gcBackground = gc.getBackground(); Color gcForeground = gc.getForeground();