if (jcr->acquired_resource_locks) {
dec_read_store(jcr);
dec_write_store(jcr);
- jcr->client->NumConcurrentJobs--;
+ if (jcr->client) {
+ jcr->client->NumConcurrentJobs--;
+ }
jcr->job->NumConcurrentJobs--;
jcr->acquired_resource_locks = false;
}
return false;
}
- if (jcr->client->NumConcurrentJobs < jcr->client->MaxConcurrentJobs) {
- jcr->client->NumConcurrentJobs++;
- } else {
- /* Back out previous locks */
- dec_write_store(jcr);
- dec_read_store(jcr);
- jcr->setJobStatus(JS_WaitClientRes);
- return false;
+ if (jcr->client) {
+ if (jcr->client->NumConcurrentJobs < jcr->client->MaxConcurrentJobs) {
+ jcr->client->NumConcurrentJobs++;
+ } else {
+ /* Back out previous locks */
+ dec_write_store(jcr);
+ dec_read_store(jcr);
+ jcr->setJobStatus(JS_WaitClientRes);
+ return false;
+ }
}
if (jcr->job->NumConcurrentJobs < jcr->job->MaxConcurrentJobs) {
jcr->job->NumConcurrentJobs++;
/* Back out previous locks */
dec_write_store(jcr);
dec_read_store(jcr);
- jcr->client->NumConcurrentJobs--;
+ if (jcr->client) {
+ jcr->client->NumConcurrentJobs--;
+ }
jcr->setJobStatus(JS_WaitJobRes);
return false;
}