You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Hangfire 1.6.0 beta2 for a new feature created by this pull #523
but we faced an issue adding a JobFilterAttribute to GlobalJobFilters.Filters when executing any job, it will fire null reference exception.
After some investigation in latest source code in dev branch we realized that the root cause of this issue is this line in GlobalJobFilters.cs
static GlobalJobFilters()
{
Filters = new JobFilterCollection
{
new CaptureCultureAttribute(),
new AutomaticRetryAttribute(),
new StatisticsHistoryAttribute(),
new ContinuationsSupportAttribute()
};
}
It seems that the collection initializer is setting JobFilterProviders.Providers -> first element in list = null
By reverting this initialization to old way, issue fixed
Just confirming I ran into this same issue with GlobalJobFilters.Filters on 1.6.0 beta2 when using the following. Thanks @abdelrady for tracking down the change. Was caused by using the following.
Guys, thanks for reporting and investigating this ❤️ It is awesome when a bug is reported during the beta. The fix is available in the CI Feed in version 1.6.0-build-02018.
Hi,
We are using Hangfire 1.6.0 beta2 for a new feature created by this pull
#523
but we faced an issue adding a JobFilterAttribute to GlobalJobFilters.Filters when executing any job, it will fire null reference exception.
After some investigation in latest source code in dev branch we realized that the root cause of this issue is this line in GlobalJobFilters.cs
It seems that the collection initializer is setting JobFilterProviders.Providers -> first element in list = null
By reverting this initialization to old way, issue fixed
We rolled back to beta1 which doesn't have this issue till you have the chance to fix it.
Attached same MVC sample (startup.cs file) in dev branch with adding a simple JobFilterAttribute to show you the issue.
startup.cs.txt
The text was updated successfully, but these errors were encountered: