diff --git a/src/libtomahawk/network/ControlConnection.cpp b/src/libtomahawk/network/ControlConnection.cpp index 25596c327..36e701fb1 100644 --- a/src/libtomahawk/network/ControlConnection.cpp +++ b/src/libtomahawk/network/ControlConnection.cpp @@ -159,9 +159,15 @@ ControlConnection::registerSource() { Q_D( ControlConnection ); QReadLocker sourceLocker( &d->sourceLock ); + if ( d->source.isNull() ) + { + // Not connected to a source anymore, nothing to do. + return; + } + QSharedPointer locker = d->source->acquireLock(); // Only continue if we are still the ControlConnection associated with this source. - if ( !d->source.isNull() && d->source->controlConnection() == this ) + if ( d->source->controlConnection() == this ) { qDebug() << Q_FUNC_INFO << d->source->id(); Source* source = (Source*) sender();