IDEA-130959 (do not start the progress when headless)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Wed, 12 Nov 2014 15:02:16 +0000 (16:02 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Wed, 12 Nov 2014 15:02:16 +0000 (16:02 +0100)
platform/core-impl/src/com/intellij/openapi/fileEditor/impl/LoadTextUtil.java

index 1d30e7e7e5d13d7086abecad06e8773ada59e58e..2792ae0baf971aa708ef6b58a4bccc2551ca3f23 100644 (file)
@@ -376,7 +376,7 @@ public final class LoadTextUtil {
         CharSequence text;
 
         Application app = ApplicationManager.getApplication();
-        if (app != null && app.isDispatchThread() && !app.isWriteAccessAllowed()) {
+        if (app != null && app.isDispatchThread() && !app.isHeadlessEnvironment() && !app.isWriteAccessAllowed()) {
           final Ref<CharSequence> result = Ref.create(ArrayUtil.EMPTY_CHAR_SEQUENCE);
           final Ref<Throwable> error = Ref.create();
           ProgressManager.getInstance().run(new Task.Modal(null, "Decompiling " + file.getName(), true) {