Wrong initialization sequence causes NPE.
authorMaxim Shafirov <max@jetbrains.com>
Mon, 12 Oct 2009 11:23:12 +0000 (15:23 +0400)
committerMaxim Shafirov <max@jetbrains.com>
Mon, 12 Oct 2009 11:23:29 +0000 (15:23 +0400)
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java

index cb59cae1d98f370e194c579b9ac34dcaea6d97b8..f89ee0501ea2beb2ed183850a9f75c17ab0debf5 100644 (file)
@@ -143,6 +143,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
   // -------------------------------------------------------------------------
 
   public FileTypeManagerImpl(MessageBus bus, SchemesManagerFactory schemesManagerFactory) {
+    myMessageBus = bus;
     mySchemesManager = schemesManagerFactory.createSchemesManager(FILE_SPEC, new SchemeProcessor<AbstractFileType>() {
       public AbstractFileType readScheme(final Document document) throws InvalidDataException {
         if (document == null) {
@@ -225,7 +226,6 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements NamedJDOME
     if (loadAllFileTypes()) {
       restoreStandardFileExtensions();
     }
-    myMessageBus = bus;
   }
 
   private static void writeImportedExtensionsMap(final Element map, final ImportedFileType type) {