Handling null range exception in IntegerRange