From 198b1f5fa5957ab67139214c24ce3c0723194c36 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Mon, 18 Mar 2019 17:56:22 +0100 Subject: [PATCH] MessageManager: Replace early return with QTC_ASSERT Change-Id: I54545365c71bed41eb12ec4d1e2e626bd39cd27d Reviewed-by: Eike Ziller --- src/plugins/coreplugin/messagemanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/messagemanager.cpp b/src/plugins/coreplugin/messagemanager.cpp index c4bf4269a4e..734a11399eb 100644 --- a/src/plugins/coreplugin/messagemanager.cpp +++ b/src/plugins/coreplugin/messagemanager.cpp @@ -40,8 +40,8 @@ MessageManager *MessageManager::instance() void MessageManager::showOutputPane(Core::MessageManager::PrintToOutputPaneFlags flags) { - if (!m_messageOutputWindow) - return; + QTC_ASSERT(m_messageOutputWindow, return); + if (flags & Flash) { m_messageOutputWindow->flash(); } else if (flags & Silent) { @@ -75,8 +75,8 @@ void MessageManager::init() void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags) { - if (!m_messageOutputWindow) - return; + QTC_ASSERT(m_messageOutputWindow, return); + showOutputPane(flags); m_messageOutputWindow->append(text + QLatin1Char('\n')); }