Check if ApplicationPolicy is not null.

We have the same check -- on potential random NPE - in handleJASPIMechanism.