Add null check into FileTypeManager isDirectory check