aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/generic.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 5df9a163fe..dcad27bc35 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -207,7 +207,7 @@ module URI
"the scheme #{@scheme} does not accept registry part: #{registry} (or bad hostname?)"
end
- @scheme.freeze if @scheme
+ @scheme&.freeze
self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2)
self.set_port(self.default_port) if self.default_port && !@port
end
@@ -330,7 +330,7 @@ module URI
# see also URI::Generic.scheme=
#
def set_scheme(v)
- @scheme = v ? v.downcase : v
+ @scheme = v&.downcase
end
protected :set_scheme