summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-14 09:06:13 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-14 09:06:13 +0000
commite3c4c7e13bcf5b202701ef5acc86b06187b5fdb7 (patch)
treea2ec29d0bfd115050b5c26dac014f6802e6aab9a /lib
parenta9e033b104921bfa0dc4e3d99df1acc9f1258db4 (diff)
* lib/uri/mailto.rb: raising URI::InvalidComponentError instead
of failing with undefined method `split' for nil:NilClass for mailto: URIs without opaque part. [Bug #10738] * test/uri/testuri.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/mailto.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index 497d963..b440563 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -135,6 +135,10 @@ module URI
@to = nil
@headers = []
+ unless @opaque
+ raise InvalidComponentError,
+ "missing opaque part for mailto URL"
+ end
to, header = @opaque.split('?', 2)
# allow semicolon as a addr-spec separator
# http://support.microsoft.com/kb/820868