Skip to content

Commit 66aeea8

Browse files
committed
Creates job data instance into PerformContext if job data not exist .
1 parent e4fa513 commit 66aeea8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Hangfire.RecurringJobExtensions/ExtendedDataJobFilter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public void OnPerforming(PerformingContext filterContext)
4545

4646
var jobDataKey = $"recurringjob-info-{jobInfo.ToString()}";
4747

48-
filterContext.Items[jobDataKey] = jobInfo.ExtendedData ?? new Dictionary<string, object>();
48+
if (jobInfo.ExtendedData == null) jobInfo.ExtendedData = new Dictionary<string, object>();
49+
50+
filterContext.Items[jobDataKey] = jobInfo.ExtendedData;
4951
}
5052
/// <summary>
5153
/// Called after the performance of the job.

0 commit comments

Comments
 (0)