crash proofing (PY-4678)
authorDmitry Jemerov <yole@jetbrains.com>
Fri, 7 Oct 2011 09:39:23 +0000 (11:39 +0200)
committerDmitry Jemerov <yole@jetbrains.com>
Fri, 7 Oct 2011 09:39:23 +0000 (11:39 +0200)
platform/platform-impl/src/com/intellij/ide/ui/LafManagerImpl.java

index 2fe97bdab9811b188bc1ab1d9e2a8765840de063..9de98fdff01848b0ea9cfb22841e19363db63703 100644 (file)
@@ -166,7 +166,9 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
   }
 
   public void initComponent() {
-    setCurrentLookAndFeel(findLaf(myCurrentLaf.getClassName())); // setup default LAF or one specified by readExternal.
+    if (myCurrentLaf != null) {
+      setCurrentLookAndFeel(findLaf(myCurrentLaf.getClassName())); // setup default LAF or one specified by readExternal.
+    }
     updateUI();
 
     if (SystemInfo.isLinux) {
@@ -220,10 +222,13 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo
 
   public Element getState() {
     Element element = new Element("state");
-    if(myCurrentLaf.getClassName()!=null){
-      Element child=new Element(ELEMENT_LAF);
-      child.setAttribute(ATTRIBUTE_CLASS_NAME,myCurrentLaf.getClassName());
-      element.addContent(child);
+    if (myCurrentLaf != null) {
+      String className = myCurrentLaf.getClassName();
+      if (className != null){
+        Element child=new Element(ELEMENT_LAF);
+        child.setAttribute(ATTRIBUTE_CLASS_NAME, className);
+        element.addContent(child);
+      }
     }
     return element;
   }