diff --git a/src/storage/plugins/UdisksStorage.cxx b/src/storage/plugins/UdisksStorage.cxx index 07ba6f45f..60f1e27e0 100644 --- a/src/storage/plugins/UdisksStorage.cxx +++ b/src/storage/plugins/UdisksStorage.cxx @@ -331,16 +331,18 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept { assert(uri_utf8 != nullptr); + if (StringIsEmpty(uri_utf8)) + /* kludge for a special case: return the "udisks://" + URI if the parameter is an empty string to fix the + mount URIs in the state file */ + return base_uri; + try { const_cast(this)->MountWait(); return mounted_storage->MapUTF8(uri_utf8); } catch (...) { /* fallback - not usable but the best we can do */ - - if (StringIsEmpty(uri_utf8)) - return base_uri; - return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8); } }