summaryrefslogtreecommitdiff
path: root/lib/ipaddress/ipv6.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipaddress/ipv6.rb')
-rw-r--r--lib/ipaddress/ipv6.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb
index 6ae651d..2205de4 100644
--- a/lib/ipaddress/ipv6.rb
+++ b/lib/ipaddress/ipv6.rb
@@ -494,6 +494,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