File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,7 @@ inline static bool prefer_user_phrase(
569569}
570570
571571bool ScriptTranslation::PrepareCandidate () {
572+ iter_incremented:
572573 if (exhausted ()) {
573574 candidate_source_ = kUninitialized ;
574575 candidate_ = nullptr ;
@@ -615,6 +616,10 @@ bool ScriptTranslation::PrepareCandidate() {
615616 })) {
616617 UserDictEntryIterator& uter = user_phrase_iter_->second ;
617618 const auto & entry = uter.Peek ();
619+ if (!entry) {
620+ ++user_phrase_iter_;
621+ goto iter_incremented;
622+ }
618623 DLOG (INFO) << " user phrase '" << entry->text
619624 << " ', code length: " << user_phrase_code_length;
620625 candidate_source_ = kUserPhrase ;
@@ -629,6 +634,10 @@ bool ScriptTranslation::PrepareCandidate() {
629634 } else if (phrase_code_length > 0 ) {
630635 DictEntryIterator& iter = phrase_iter_->second ;
631636 const auto & entry = iter.Peek ();
637+ if (!entry) {
638+ ++phrase_iter_;
639+ goto iter_incremented;
640+ }
632641 DLOG (INFO) << " phrase '" << entry->text
633642 << " ', code length: " << phrase_code_length;
634643 candidate_source_ = kSysPhrase ;
You can’t perform that action at this time.
0 commit comments