IDEA-145975 Exception appears when first run IDEA (UI Themes page) webstorm/144.301
authorKonstantin Bulenkov <kb@jetbrains.com>
Tue, 13 Oct 2015 15:20:21 +0000 (17:20 +0200)
committerKonstantin Bulenkov <kb@jetbrains.com>
Tue, 13 Oct 2015 15:20:21 +0000 (17:20 +0200)
platform/editor-ui-api/src/com/intellij/ide/ui/AntialiasingType.java

index 227e1fb17350e94570a2d3942ca86ee9470378fa..c4f97c23c14871f1f5defac5c41bc931a4ef5d88 100644 (file)
@@ -15,6 +15,8 @@
  */
 package com.intellij.ide.ui;
 
+import com.intellij.openapi.application.Application;
+import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.util.ui.UIUtil;
 import sun.swing.SwingUtilities2;
 
@@ -36,9 +38,13 @@ public enum AntialiasingType {
   }
 
   public static Object getAAHintForSwingComponent() {
-    UISettings uiSettings = UISettings.getInstance();
+    Application application = ApplicationManager.getApplication();
+
+    if (application == null) {
+      return getAAEnabledTextInfo();
+    }
 
-    if (uiSettings == null) return getAAEnabledTextInfo();
+    UISettings uiSettings = UISettings.getInstance();
 
     switch (uiSettings.IDE_AA_TYPE) {
       case SUBPIXEL: