Skip to content

Commit

Permalink
fix a crash when trying to unlock volume by clicking the "mount volum…
Browse files Browse the repository at this point in the history
…e" button
  • Loading branch information
mhogomchungu committed Aug 3, 2020
1 parent 168aaef commit 7c09ad9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sirikali.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1606,19 +1606,23 @@ void sirikali::autoMount( const QString& volume )
{
if( !volume.isEmpty() ){

auto& favorites = favorites::instance() ;

auto s = settings::instance().autoOpenFolderOnMount() ;

auto m = [ & ](){

for( auto&& it : favorites::instance().readVolumeList() ){
for( auto&& it : favorites.readVolumeList() ){

if( it.favorite.volumePath == volume ){

return this->autoUnlockVolumes( { std::move( it ) },s ) ;
}
}

return this->autoUnlockVolumes( { { volume,{} } },s ) ;
auto& tmp = favorites.getTmpFavoriteEntries() ;

return this->autoUnlockVolumes( { { tmp.add( volume ) } },s ) ;
}() ;

this->mountMultipleVolumes( std::move( m ) ) ;
Expand Down

0 comments on commit 7c09ad9

Please sign in to comment.