From 8f1829c10ba3de26fc6f21be4ca74203d74c871f Mon Sep 17 00:00:00 2001 From: Riccardo Bernardini <> Date: Sat, 3 Oct 2015 08:14:44 +0200 Subject: Crash. Fix for Bug #1404934 (Crash when opening files (Glib::ConvertError exception)). Fixed bugs: - https://launchpad.net/bugs/1404934 (bzr r14393) --- src/resource-manager.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/resource-manager.cpp') 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 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()); } } } -- cgit v1.2.3