summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-03-07 12:56:19 +0800
committerPeng Wu <alexepico@gmail.com>2017-03-07 12:56:19 +0800
commit2919d7d4b9facf175d4da33418dfbb9945f4bb15 (patch)
tree97b6fdc06396518cb13e70f9ddd05ae9e132d44c
parent9fe72f37c17ecdccf4fe38327022fec8cfdc05f4 (diff)
downloadlibpinyin-2919d7d4b9facf175d4da33418dfbb9945f4bb15.zip
libpinyin-2919d7d4b9facf175d4da33418dfbb9945f4bb15.tar.gz
libpinyin-2919d7d4b9facf175d4da33418dfbb9945f4bb15.tar.xz
fixes crash1.9.92
-rw-r--r--src/pinyin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 57defcc..156adf6 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -2062,6 +2062,9 @@ bool pinyin_train(pinyin_instance_t * instance, guint8 index){
PhoneticKeyMatrix & matrix = instance->m_matrix;
NBestMatchResults & results = instance->m_nbest_results;
+ if (0 == results.size())
+ return false;
+
context->m_modified = true;
MatchResult result = NULL;