fix crash in load map dialog when you have no permissions on /media
This commit is contained in:
parent
2db29bb02c
commit
09d988b144
1 changed files with 10 additions and 3 deletions
|
@ -109,9 +109,16 @@ void enumerate_storage_devices(std::vector<path_info>& res)
|
|||
|
||||
for(const auto& mnt : candidates) {
|
||||
bsys::error_code e;
|
||||
if(bfs::is_directory(mnt, e) && !bfs::is_empty(mnt, e) && !e) {
|
||||
DBG_DU << "enumerate_mount_parents(): " << mnt << " appears to be a non-empty dir\n";
|
||||
res.push_back({mnt, "", mnt});
|
||||
try {
|
||||
if(bfs::is_directory(mnt, e) && !bfs::is_empty(mnt, e) && !e) {
|
||||
DBG_DU << "enumerate_mount_parents(): " << mnt << " appears to be a non-empty dir\n";
|
||||
res.push_back({mnt, "", mnt});
|
||||
}
|
||||
}
|
||||
catch(...) {
|
||||
//bool is_empty(const path& p, system::error_code& ec) might throw.
|
||||
//For example if you have no permission on that directory. Don't list the file in that case.
|
||||
DBG_DU << "caught exception in enumerate_storage_devices\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue