Added defensive code to protect null def folder
CORE-5427