summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2019-07-26 17:41:12 +0800
committerPeng Wu <alexepico@gmail.com>2019-07-26 17:41:12 +0800
commit197e1b6c16608956141cd3668d35e4c22d18027e (patch)
treeb85b97de909e729d186257ce5082b1caf6d09892
parent86cd6d89193b2137f6ad622e1b6939ae2677fc1b (diff)
downloadibus-libpinyin-197e1b6c16608956141cd3668d35e4c22d18027e.tar.gz
ibus-libpinyin-197e1b6c16608956141cd3668d35e4c22d18027e.tar.xz
ibus-libpinyin-197e1b6c16608956141cd3668d35e4c22d18027e.zip
fixes crash in clearPinyinUserData method
-rw-r--r--src/PYLibPinyin.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
index 34e2424..c27dd2a 100644
--- a/src/PYLibPinyin.cc
+++ b/src/PYLibPinyin.cc
@@ -291,6 +291,9 @@ LibPinyinBackEnd::exportPinyinDictionary (const char *filename)
gboolean
LibPinyinBackEnd::clearPinyinUserData (const char *target)
{
+ if (NULL == m_pinyin_context)
+ return FALSE;
+
if (0 == strcmp ("all", target)) {
pinyin_mask_out (m_pinyin_context, 0x0, 0x0);
} else if (0 == strcmp ("user", target)) {