ソースを参照

Potentially fix NPE in FontPicker.

pull/402/head
Greg Holmes 9年前
コミット
8276358d15
1個のファイルの変更4行の追加1行の削除
  1. 4
    1
      ui_swing/src/com/dmdirc/addons/ui_swing/components/FontPicker.java

+ 4
- 1
ui_swing/src/com/dmdirc/addons/ui_swing/components/FontPicker.java ファイルの表示

@@ -65,7 +65,10 @@ public class FontPicker extends JComboBox<Object> {
65 65
      * @param fonts Fonts to load
66 66
      */
67 67
     private void loadFonts(final String... fonts) {
68
-        final int size = getFont().getSize();
68
+        if (fonts == null) {
69
+            return;
70
+        }
71
+        final int size = getFont() == null ? 12 : getFont().getSize();
69 72
         for (final String font : fonts) {
70 73
             ((MutableComboBoxModel<Object>) getModel()).addElement(new Font(font, Font.PLAIN, size));
71 74
         }

読み込み中…
キャンセル
保存