SpringApplicationContextInjector threw a NPE for a <task class="..."/> (i.e. with a null bean reference)

Fixed a NullPointerException (a null bean name) in case the custom task has a task via its class attribute. Extracted part of the logic and added comments for readability.