From ef9c5e47bb98a79a71beb45c9b0ffeda2e86f38c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 24 Apr 2018 14:07:17 +0200 Subject: [PATCH] Core: Turn soft assert into if clause It is perfectly legal to have a plugin disabled that was enabled before. If the respective plugin has an output pane the respective setting had been stored and the pane can not be restored when the plugin is not loaded. Change-Id: I25910c44dba83faf3c52ae836f2e83d0e69236d5 Reviewed-by: hjk --- src/plugins/coreplugin/outputpanemanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index f14c1097b5c..7262decedf7 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -432,7 +432,8 @@ void OutputPaneManager::readSettings() settings->setArrayIndex(i); Id id = Id::fromSetting(settings->value(QLatin1String(outputPaneIdKeyC))); const int idx = Utils::indexOf(g_outputPanes, Utils::equal(&OutputPaneData::id, id)); - QTC_ASSERT(idx >= 0, continue); + if (idx < 0) // happens for e.g. disabled plugins (with outputpanes) that were loaded before + continue; const bool visible = settings->value(QLatin1String(outputPaneVisibleKeyC)).toBool(); g_outputPanes[idx].buttonVisible = visible; g_outputPanes[idx].button->setVisible(visible);