diff options
| author | Randall Lee <randall.lee@mapbox.com> | 2018-05-22 14:09:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-22 14:09:36 -0400 |
| commit | d858cb783b499a1cc77b48a0faee137ca5e6a423 (patch) | |
| tree | 5c36c353730e3050d44e472545519c0429723266 /src/mbgl/util/url.cpp | |
| parent | f93d722458be62d567aa152711a014ef51a90193 (diff) | |
| parent | 60505b03174b5ec02ae723beafa7683f6ed54a62 (diff) | |
| download | qtlocation-mapboxgl-upstream/rclee-async-setup.tar.gz | |
Merge branch 'master' into rclee-async-setupupstream/rclee-async-setup
Diffstat (limited to 'src/mbgl/util/url.cpp')
| -rw-r--r-- | src/mbgl/util/url.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/util/url.cpp b/src/mbgl/util/url.cpp index 1f6dab9639..a4263502ef 100644 --- a/src/mbgl/util/url.cpp +++ b/src/mbgl/util/url.cpp @@ -130,7 +130,7 @@ Path::Path(const std::string& str, const size_t pos, const size_t count) } std::string transformURL(const std::string& tpl, const std::string& str, const URL& url) { - auto result = util::replaceTokens(tpl, [&](const std::string& token) -> std::string { + auto result = util::replaceTokens(tpl, [&](const std::string& token) -> optional<std::string> { if (token == "path") { return str.substr(url.path.first, url.path.second); } else if (token == "domain") { @@ -146,8 +146,9 @@ std::string transformURL(const std::string& tpl, const std::string& str, const U } else if (token == "extension") { const Path path(str, url.path.first, url.path.second); return str.substr(path.extension.first, path.extension.second); + } else { + return {}; } - return ""; }); // Append the query string if it exists. |
