Skip to content

Commit

Permalink
Prevent NPE when desktopHints are null.
Browse files Browse the repository at this point in the history
  • Loading branch information
weisJ committed Sep 22, 2020
1 parent 52b9abb commit 295a08c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ private void setupRenderingHints(final UIDefaults defaults) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Map<?, ?> desktopHints = (Map<?, ?>) toolkit.getDesktopProperty(GraphicsUtil.DESKTOP_HINTS_KEY);

if (desktopHints == null) {
desktopHints = Collections.emptyMap();
}

Object aaHint = desktopHints.get(RenderingHints.KEY_TEXT_ANTIALIASING);
Object lcdContrastHint = desktopHints.get(RenderingHints.KEY_TEXT_LCD_CONTRAST);

Expand Down

0 comments on commit 295a08c

Please sign in to comment.