Add null check for int/long fields when checking min/max