Commit 83f7610d authored by Max Kellermann's avatar Max Kellermann

storage/udisks2: move empty string check out of the fallback block in MapUTF8()

Even if the LocalStorage is available, return the "udisks://" URI when the MapUTF8() parameter is an empty string. This fixes the mount URI in the state file.
parent 30e06447
......@@ -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<UdisksStorage *>(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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment