From 878671e36c28a4cebec659df527b9a1d8c0703e6 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 15 Sep 2012 11:49:31 +0200 Subject: [PATCH] scide: MainWindow - fix crash in focusCodeEditor Signed-off-by: Tim Blechmann --- editors/sc-ide/widgets/main_window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editors/sc-ide/widgets/main_window.cpp b/editors/sc-ide/widgets/main_window.cpp index 1c7d96bb3..fbefe0da0 100644 --- a/editors/sc-ide/widgets/main_window.cpp +++ b/editors/sc-ide/widgets/main_window.cpp @@ -557,7 +557,10 @@ void MainWindow::restoreWindowState() void MainWindow::focusCodeEditor() { - mEditors->currentEditor()->setFocus(); + if (mEditors->currentEditor()) + mEditors->currentEditor()->setFocus(); + else + mEditors->setFocus(); } void MainWindow::newSession() -- 2.11.4.GIT