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 <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-11-14 13:00:23 +01:00
parent da18c76b96
commit 77bea93a6e

View File

@@ -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);