summaryrefslogtreecommitdiffstats
path: root/tdeio
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2024-09-27 14:26:22 +0200
committerSlávek Banko <slavek.banko@axis.cz>2024-09-27 14:26:22 +0200
commite22af1c0a03ce2cb14b051edfc8ee11b31896341 (patch)
tree40c68b1b779512c501488927471f2eed8db1c397 /tdeio
parentd7639e89d0b4a7fe878ebcfbc3e5f0cfcba04a81 (diff)
downloadtdelibs-e22af1c0a03ce2cb14b051edfc8ee11b31896341.tar.gz
tdelibs-e22af1c0a03ce2cb14b051edfc8ee11b31896341.zip
tdeio - scheduler: Fix crash if the job or slave are not valid.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeio')
-rw-r--r--tdeio/tdeio/scheduler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tdeio/tdeio/scheduler.cpp b/tdeio/tdeio/scheduler.cpp
index 30c2d8375..abc631284 100644
--- a/tdeio/tdeio/scheduler.cpp
+++ b/tdeio/tdeio/scheduler.cpp
@@ -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)))