From 74ae8314df5243bff6edd15050ad651a290aea0d Mon Sep 17 00:00:00 2001
From: con <qtc-committer@nokia.com>
Date: Fri, 26 Mar 2010 13:09:49 +0100
Subject: [PATCH] Some sanity checks in editor tool bar.

---
 src/plugins/coreplugin/editortoolbar.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp
index 6fa3737cca7..f01dbffe72e 100644
--- a/src/plugins/coreplugin/editortoolbar.cpp
+++ b/src/plugins/coreplugin/editortoolbar.cpp
@@ -159,6 +159,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
 
 void EditorToolBar::removeToolbarForEditor(IEditor *editor)
 {
+    QTC_ASSERT(editor, return)
     disconnect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
 
     QWidget *toolBar = editor->toolBar();
@@ -190,6 +191,7 @@ void EditorToolBar::closeView()
 
 void EditorToolBar::addEditor(IEditor *editor)
 {
+    QTC_ASSERT(editor, return)
     connect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
     QWidget *toolBar = editor->toolBar();
 
@@ -201,6 +203,7 @@ void EditorToolBar::addEditor(IEditor *editor)
 
 void EditorToolBar::addCenterToolBar(QWidget *toolBar)
 {
+    QTC_ASSERT(toolBar, return)
     toolBar->setVisible(false); // will be made visible in setCurrentEditor
     m_toolBarPlaceholder->layout()->addWidget(toolBar);
 
@@ -232,6 +235,7 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags)
 
 void EditorToolBar::setCurrentEditor(IEditor *editor)
 {
+    QTC_ASSERT(editor, return)
     m_editorList->setCurrentIndex(m_editorsListModel->indexOf(editor).row());
 
     // If we never added the toolbar from the editor,  we will never change
-- 
GitLab