ncm: don't unmount if mounting fails

This commit is contained in:
Adubbz 2020-03-07 17:53:33 +11:00
parent 9717b554c5
commit db76561d45

View file

@ -344,12 +344,11 @@ namespace ams::ncm {
R_TRY(this->GetContentMetaDatabaseRoot(&root, storage_id));
/* Mount save data for non-existing content meta databases. */
auto mount_guard = SCOPE_GUARD { fs::Unmount(root->mount_name); };
if (!root->content_meta_database) {
const bool mount = !root->content_meta_database;
if (mount) {
R_TRY(fs::MountSystemSaveData(root->mount_name, root->info.space_id, root->info.id));
} else {
mount_guard.Cancel();
}
auto mount_guard = SCOPE_GUARD { if (mount) { fs::Unmount(root->mount_name); } };
/* Ensure the root path exists. */
bool has_dir = false;