aboutsummaryrefslogtreecommitdiff
path: root/libbutl/url.txx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:20:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-09 17:20:37 +0300
commit681ca375fd5af01501a91a78214ab7a26ad67ac7 (patch)
treecdf464f5001ce891e1129e07fc97253c9b321cb5 /libbutl/url.txx
parent726f4573a5d183a685e0a1032a3e247e3b47482e (diff)
Make basic_url(string) ctor to consider empty string as invalid argument
Diffstat (limited to 'libbutl/url.txx')
-rw-r--r--libbutl/url.txx9
1 files changed, 3 insertions, 6 deletions
diff --git a/libbutl/url.txx b/libbutl/url.txx
index 26bd60a..b520509 100644
--- a/libbutl/url.txx
+++ b/libbutl/url.txx
@@ -226,14 +226,11 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
using iterator = typename string_type::const_iterator;
- // Create an empty URL object for the empty argument. Note that the scheme
- // is default-constructed, and so may stay undefined in this case.
- //
- if (u.empty ())
- return;
-
try
{
+ if (u.empty ())
+ throw invalid_argument ("empty URL");
+
// At the end of a component parsing 'i' points to the next component
// start, and 'b' stays unchanged.
//