diff --git a/src/dict/epwing.cc b/src/dict/epwing.cc index 32c9d993..7a00394e 100644 --- a/src/dict/epwing.cc +++ b/src/dict/epwing.cc @@ -361,9 +361,7 @@ void EpwingDictionary::loadArticleNextPage(string & articleHeadword, string & ar } catch( std::exception & e ) { - text = QString( "Article reading error: %1") - .arg( QString::fromUtf8( e.what() ) ); - articleText = string( text.toUtf8().data() ); + qWarning() << QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) ); return; } @@ -399,8 +397,7 @@ void EpwingDictionary::loadArticlePreviousPage( pos = eBook.getArticlePreviousPage( headword, text, articlePage, articleOffset, false ); } catch( std::exception & e ) { - text = QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) ); - articleText = string( text.toUtf8().data() ); + qDebug() << QString( "Article reading error: %1" ).arg( QString::fromUtf8( e.what() ) ); return; } @@ -778,6 +775,15 @@ void EpwingArticleRequest::run() dict.loadArticlePreviousPage( headword, articleText, articlePage, articleOffset ); } + //the reference may not contain valid text. at this point ,should return directly. + if ( articleText.empty() ) { + //clear result. + result.clear(); + // No such word + finish(); + return; + } + result += articleText; } diff --git a/thirdparty/eb b/thirdparty/eb index ec8904dc..f45db88f 160000 --- a/thirdparty/eb +++ b/thirdparty/eb @@ -1 +1 @@ -Subproject commit ec8904dc8b390b746573492806790cd11b164927 +Subproject commit f45db88f160a9e597c3e050d37c011934fa5e773