Fix for custom mapping returning null when condition failed