Skip to content

Commit d11eda0

Browse files
selundqmafedejeanne
authored andcommitted
Colors are null in Section onPaint and cause null pointer exception #2972
Changed code found in Section.class (onPaint) which lets null values slip through and cause null pointer exception. Fixes #2972
1 parent bfeb6c6 commit d11eda0

File tree

1 file changed

+2
-1
lines changed
  • bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets

1 file changed

+2
-1
lines changed

bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/Section.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ private void putTitleBarColor(String key, Color color) {
316316
@Override
317317
protected void onPaint(PaintEvent e) {
318318
Color bg = (titleColors != null) ? titleColors.getOrDefault(COLOR_BG, getBackground()) : getBackground();
319-
Color fg = (titleColors != null) ? getTitleBarForeground() : getForeground();
319+
Color fg = (titleColors != null) ? (getTitleBarForeground() != null
320+
? getTitleBarForeground() : getForeground()) : getForeground();
320321
Color border = (titleColors != null) ? titleColors.getOrDefault(COLOR_BORDER, fg) : fg;
321322

322323
GC gc = e.gc;

0 commit comments

Comments
 (0)