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
This commit is contained in:
mguessan 2014-02-11 19:53:57 +00:00
parent bf686bb9ef
commit 9c48dd351f
1 changed files with 2 additions and 1 deletions

View File

@ -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));