Closed Rhast0r closed 5 years ago
I assume you mean that it only happens during validation? When I run that code and call Create() on your factory it works fine.
During validation, zenject only instantiates those classes that implement the IValidatable interface, which PlaceholderFactory does. This is why it tries to create your factory during validation. But SignalBus is not an IValidatable so it gets injected as null.
Can you just remove your null checking in the constructor of your factory? Since null is expected there during validation so not really an error
By the way - see here for more details: https://github.com/svermeulen/Zenject#object-graph-validation
Here is an example of how to reproduce the error. It does not only happen with the SignalBus but with any other binding made