diff options
| author | Jesper K. Pedersen <jesper.pedersen@kdab.com> | 2013-05-15 08:44:36 +0200 |
|---|---|---|
| committer | Jesper K. Pedersen <jesper.pedersen@kdab.com> | 2013-05-16 07:36:56 +0200 |
| commit | a7260a4b6a82b25642da26854e6e8199220cd1d3 (patch) | |
| tree | 67c9fd1e5ce7f50129a28a559662c0253f52696c | |
| parent | 36823affca3dc1584e81173c740304df97810a3f (diff) | |
do not crash when no editor has been found
Change-Id: I12b1ed77c4cf03d18a902cdc789071a6302306f7
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
| -rw-r--r-- | objects/editors.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/objects/editors.cpp b/objects/editors.cpp index 17fad9f..3959a4d 100644 --- a/objects/editors.cpp +++ b/objects/editors.cpp @@ -66,7 +66,11 @@ static Editor *wrapEditor(Core::IEditor *editor) { Editor * Editors::current() { - return wrapEditor(Core::EditorManager::instance()->currentEditor()); + Core::IEditor *editor = Core::EditorManager::instance()->currentEditor(); + if ( editor ) + return wrapEditor(editor); + else + return 0; } bool Editors::hasEditor(const QString &fileName) |
