8210739: Calling JSpinner's setFont with null throws NullPointerException

Reviewed-by: psadhukhan
This commit is contained in:
Sergey Bylokhov 2018-10-16 15:47:53 -07:00
parent 0ed2c6c295
commit 518f32791a
4 changed files with 107 additions and 9 deletions

View file

@ -769,7 +769,7 @@ public class JSpinner extends JComponent implements Accessible
// the text field font was not set by the user
Font font = spinner.getFont();
if (!newfont.equals(font)) {
getTextField().setFont(new FontUIResource(font));
getTextField().setFont(font == null ? null : new FontUIResource(font));
}
}
}