during the dependency injection, if spring fails to satisfy an injection point(constructor parameter, setter method parameter or field), it will throw exception indicating no qualifying bean definition was found.
you could signal spring dependency injector that it is ok to pass us null in the case of satisfying bean definition absence.