summaryrefslogtreecommitdiffstats
path: root/src/resource-manager.cpp
diff options
context:
space:
mode:
authorRiccardo Bernardini <>2015-10-03 06:14:44 +0000
committerJazzyNico <nicoduf@yahoo.fr>2015-10-03 06:14:44 +0000
commit8f1829c10ba3de26fc6f21be4ca74203d74c871f (patch)
treeb63ada429d29bb678f85226a0120078a71510c7f /src/resource-manager.cpp
parentFixes some non-antisymmetrical sort function (diff)
downloadinkscape-8f1829c10ba3de26fc6f21be4ca74203d74c871f.tar.gz
inkscape-8f1829c10ba3de26fc6f21be4ca74203d74c871f.zip
Crash. Fix for Bug #1404934 (Crash when opening files (Glib::ConvertError exception)).
Fixed bugs: - https://launchpad.net/bugs/1404934 (bzr r14393)
Diffstat (limited to 'src/resource-manager.cpp')
-rw-r--r--src/resource-manager.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/resource-manager.cpp b/src/resource-manager.cpp
index fe53eca4f..dbff27827 100644
--- a/src/resource-manager.cpp
+++ b/src/resource-manager.cpp
@@ -222,11 +222,15 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us
Glib::ustring uri = (*it)->get_uri();
std::string scheme = Glib::uri_parse_scheme(uri);
if ( scheme == "file" ) {
- std::string path = Glib::filename_from_uri(uri);
- path = Glib::path_get_dirname(path);
- if ( std::find(priorLocations.begin(), priorLocations.end(), path) == priorLocations.end() ) {
- // TODO debug g_message(" ==>[%s]", path.c_str());
- priorLocations.push_back(path);
+ try {
+ std::string path = Glib::filename_from_uri(uri);
+ path = Glib::path_get_dirname(path);
+ if ( std::find(priorLocations.begin(), priorLocations.end(), path) == priorLocations.end() ) {
+ // TODO debug g_message(" ==>[%s]", path.c_str());
+ priorLocations.push_back(path);
+ }
+ } catch (Glib::ConvertError e) {
+ g_warning("Bad URL ignored [%s]", uri.c_str());
}
}
}