listener is Nullable, so we should check it before using it

Comment From: sbrannen

Please note that the first line in that method is:

Assert.state(this.parser != null && this.listener != null, "Not initialized yet");

@GungnirLaevatain, do you have a concrete use case where you experienced a NullPointerException in this context?