tdeio - scheduler: Fix crash if the job or slave are not valid.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e22af1c0a0)
pull/312/head
Slávek Banko 2 months ago
parent 23d94945e5
commit 3d8df21c1d
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -796,6 +796,18 @@ Scheduler::_assignJobToSlave(TDEIO::Slave *slave, SimpleJob *job)
{
// kdDebug(7006) << "_assignJobToSlave( " << job << ", " << slave << ")" << endl;
TQString dummy;
if (!job)
{
kdDebug(7006) << "_assignJobToSlave(): ERROR, non-existing job." << endl;
return false;
}
if (!slave)
{
kdDebug(7006) << "_assignJobToSlave(): ERROR, non-existing slave." << endl;
job->kill();
return false;
}
if ((slave->slaveProtocol() != KProtocolManager::slaveProtocol( job->url(), dummy ))
||
(!newJobs.removeRef(job)))

Loading…
Cancel
Save