For ENG-6530, fix a potential NPE.