Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceCollectionJobFactory returns a null job if IJob derived type not added to Services container #110

Open
jsobell opened this issue Sep 19, 2021 · 0 comments

Comments

@jsobell
Copy link

jsobell commented Sep 19, 2021

If an IJob based instance is specified but not added to the IoC container, the call to ServiceCollectionJobFactory.NewJob returns a null object.
This results in an untraceable Quartz.Net exception of 'null reference', but a feedback of "Job triggered successfully."
https://github.com/maikebing/SilkierQuartz/blob/0f420e80e8c6ad0e24895ba2de1109a23d993461/src/SilkierQuartz/HostedService/ServiceCollectionJobFactory.cs#L25 either needs an 'else' that throws an exception or needs to attempt to instantiate a default parameterless instance of the type, but it looks as though the current code hasn't been fully implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant