diff options
author | Francis Luong (Franco) <franco@definefunk.com> | 2017-08-30 07:49:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-30 07:49:23 -0400 |
commit | 335e3433869581fb3e1ece78999aed473c3ea989 (patch) | |
tree | ded60f7e337a409363703bf988a03fba616df6b6 /lib/ipaddress/ipv6.rb | |
parent | 6f0efd8d852adc10bea044d38603000c6acd0d2d (diff) | |
parent | c534ea04cb6b69d10878b3049d494f06f411fc6b (diff) | |
download | ipaddress-335e3433869581fb3e1ece78999aed473c3ea989.tar.gz |
Merge branch 'master' into improve-remove_warningsimprove-remove_warnings
Diffstat (limited to 'lib/ipaddress/ipv6.rb')
-rw-r--r-- | lib/ipaddress/ipv6.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb index 6ae651d..3e506ac 100644 --- a/lib/ipaddress/ipv6.rb +++ b/lib/ipaddress/ipv6.rb @@ -87,6 +87,7 @@ module IPAddress; # ip6 = IPAddress "2001:db8::8:800:200c:417a/64" # def initialize(str) + raise ArgumentError, "Nil IP" unless str ip, netmask = str.split("/") if str =~ /:.+\./ @@ -494,6 +495,7 @@ module IPAddress; # #=> ["2001:db8:1::1/64","2001:db8:1::1/65","2001:db8:2::1/64"] # def <=>(oth) + return nil unless oth.is_a?(self.class) return prefix <=> oth.prefix if to_u128 == oth.to_u128 to_u128 <=> oth.to_u128 end |