MPS-19678 NPE in TemplateModelScanner.safeIsInstanceOf when generator model is invalid (required references are null)