fix: access violation

This commit is contained in:
Xiao YiFang 2022-10-03 10:35:47 +08:00
parent 7c30b89336
commit e8764d322c

View file

@ -1136,11 +1136,15 @@ void ScanPopup::altModePoll()
void ScanPopup::pageLoaded( ArticleView * )
{
definition->hasSound([this](bool has){
ui.pronounceButton->setVisible( has );
});
if( !isVisible() )
return;
auto pronounceBtn = ui.pronounceButton;
definition->hasSound(
[ pronounceBtn ]( bool has )
{
if( pronounceBtn )
pronounceBtn->setVisible( has );
} );
updateBackForwardButtons();