Fix a NPE that would arise from a null permission