From 46c09e77cd73cfb54ef328799a287bf37191fc01 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 2 May 2011 18:04:01 +0200
Subject: [PATCH] change createEditor() error handling

take it out of the editor->open() error path. it's unrelated.
---
 src/plugins/coreplugin/editormanager/editormanager.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 7b098cdc251..0650599e378 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -1211,18 +1211,20 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
         return activateEditor(view, editor, flags);
     }
 
-    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
     IEditor *editor = createEditor(editorId, fn);
     // If we could not open the file in the requested editor, fall
     // back to the default editor:
     if (!editor)
         editor = createEditor(QString(), fn);
+    if (!editor) // Internal error
+        return 0;
+
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
     QString errorString;
-    if (!editor || !editor->open(&errorString, fn)) {
+    if (!editor->open(&errorString, fn)) {
         QApplication::restoreOverrideCursor();
         QMessageBox::critical(m_d->m_core->mainWindow(), tr("File Error"), errorString);
         delete editor;
-        editor = 0;
         return 0;
     }
     addEditor(editor);
-- 
GitLab