From 9c48dd351f48aef1a46ea6c64fa678af274501e3 Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 11 Feb 2014 19:53:57 +0000 Subject: [PATCH] From coverity: editor pane font can be null git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2234 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/ui/AboutFrame.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/ui/AboutFrame.java b/src/java/davmail/ui/AboutFrame.java index fc18e86b..dc107686 100644 --- a/src/java/davmail/ui/AboutFrame.java +++ b/src/java/davmail/ui/AboutFrame.java @@ -72,7 +72,8 @@ public class AboutFrame extends JFrame { jEditorPane = new JEditorPane(); HTMLEditorKit htmlEditorKit = new HTMLEditorKit(); StyleSheet stylesheet = htmlEditorKit.getStyleSheet(); - stylesheet.addRule("body { font-size:small;font-family: " + jEditorPane.getFont().getFamily() + '}'); + Font font = jEditorPane.getFont(); + stylesheet.addRule("body { font-size:small;font-family: " + ((font==null)?"Arial":font.getFamily()) + '}'); jEditorPane.setEditorKit(htmlEditorKit); jEditorPane.setContentType("text/html"); jEditorPane.setText(getContent(null));