forked from qt-creator/qt-creator
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:
@@ -1214,7 +1214,7 @@ Project *RunControl::project() const
|
|||||||
|
|
||||||
bool RunControl::canReUseOutputPane(const RunControl *other) const
|
bool RunControl::canReUseOutputPane(const RunControl *other) const
|
||||||
{
|
{
|
||||||
if (other->isRunning())
|
if (!other || other->isRunning())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return d->runnable.canReUseOutputPane(other->d->runnable);
|
return d->runnable.canReUseOutputPane(other->d->runnable);
|
||||||
|
|||||||
Reference in New Issue
Block a user