From 761272c4a1f7183f52488de38271fef21d9e7921 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 2 Apr 2025 10:11:14 -0400 Subject: [PATCH] Fix job-completed event notifications for jobs that are canceled before they are started (Issue #1209) --- scheduler/subscriptions.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 4e42c9c09d..f10b217164 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -89,6 +89,9 @@ cupsdAddEvent( * caches... */ + if (job && !dest) + dest = cupsdFindPrinter(job->dest); + for (temp = NULL, sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); sub; sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions)) @@ -115,11 +118,7 @@ cupsdAddEvent( temp->time = time(NULL); temp->attrs = ippNew(); temp->job = job; - - if (dest) - temp->dest = dest; - else if (job) - temp->dest = dest = cupsdFindPrinter(job->dest); + temp->dest = dest; /* * Add common event notification attributes... -- 2.47.2