Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise ArgumentError if IP is nil #41

Closed
wants to merge 1 commit into from

Conversation

ghg
Copy link
Contributor

@ghg ghg commented Jun 7, 2014

We end up doing a lot of calculations before actually instantiating an IPAddress object. Occasionally we end up passing a nil value which results in:

pry(main)> ip = IPAddress::IPv4.new(nil)
NoMethodError: undefined method `split' for nil:NilClass

This PR raises the same exception that is raised for invalid input when given nil input.

@ghg
Copy link
Contributor Author

ghg commented Jun 7, 2014

After submitting, I noticed my editor stripped a lot of extraneous whitespace. I'll be more than happy to split this into a separate commit, or undo the whitespace deletion all together.

Thanks!

@mikemackintosh
Copy link
Collaborator

@ghg could you please resubmit without the whitespace changes?

Looking at the following looks good and consistent across IPv4 and 6:
ghg@86a7876?w=0

@mikemackintosh mikemackintosh self-assigned this Mar 24, 2015
@ghg
Copy link
Contributor Author

ghg commented May 31, 2015

My apologies for missing the notification on this. I have resubmitted the PR without the whitespace changes ( #64 ).

Thanks!

@smortex smortex closed this Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants