From 77bea93a6ee09ed7dcccdbb5f28dc14bdb593e0f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 14 Nov 2017 13:00:23 +0100 Subject: [PATCH] RunControl: Make RunControl::canReUseAppOutputPane more robust The pointer passed in was assumed to be non-null, but that does not need to be the case. This should make the function more robust in face of errors. The RunControl passed into the method is taken from a QPointer. So if the RunControl is destroyed, that pointer may be nullptr. Task-number: QTCREATORBUG-19269 Change-Id: I42e7b9d5582df2ee0830c8f92af4e4a97e7d6417 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/runconfiguration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 03843d3a9ea..9923486a732 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -1214,7 +1214,7 @@ Project *RunControl::project() const bool RunControl::canReUseOutputPane(const RunControl *other) const { - if (other->isRunning()) + if (!other || other->isRunning()) return false; return d->runnable.canReUseOutputPane(other->d->runnable);