mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Merge pull request #1357 from xiaoyifang/fix/dictionary-crash
fix: validate the dictionary when push it into the variable
This commit is contained in:
commit
730a4b24cf
|
@ -45,7 +45,9 @@ Group::Group( Config::Group const & cfgGroup,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ( const auto & dictId : dictOrderList ) {
|
for ( const auto & dictId : dictOrderList ) {
|
||||||
dictionaries.push_back( groupDicts[ dictId ] );
|
if ( groupDicts.contains( dictId ) ) {
|
||||||
|
dictionaries.push_back( groupDicts[ dictId ] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1652,8 +1652,8 @@ void MainWindow::updateDictionaryBar()
|
||||||
if ( currentId == Instances::Group::AllGroupId )
|
if ( currentId == Instances::Group::AllGroupId )
|
||||||
dictionaryBar.setMutedDictionaries( &cfg.mutedDictionaries );
|
dictionaryBar.setMutedDictionaries( &cfg.mutedDictionaries );
|
||||||
else {
|
else {
|
||||||
Config::Group * grp = cfg.getGroup( currentId );
|
Config::Group * _grp = cfg.getGroup( currentId );
|
||||||
dictionaryBar.setMutedDictionaries( grp ? &grp->mutedDictionaries : nullptr );
|
dictionaryBar.setMutedDictionaries( _grp ? &_grp->mutedDictionaries : nullptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
dictionaryBar.setDictionaries( grp->dictionaries );
|
dictionaryBar.setDictionaries( grp->dictionaries );
|
||||||
|
|
Loading…
Reference in a new issue