Added NSNull check to ensure backwards compatibility with Mantle