For ENG-5962, fix NPE