summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ZYZPhoneticEditor.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc
index d7d570a..a3ce572 100644
--- a/src/ZYZPhoneticEditor.cc
+++ b/src/ZYZPhoneticEditor.cc
@@ -895,7 +895,8 @@ PhoneticEditor::getZhuyinCursor (void)
zhuyin_get_sentence (instance, &sentence);
if (cursor >= parsed_len) {
cursor -= parsed_len;
- zhuyin_cursor += g_utf8_strlen (sentence, -1);
+ if (sentence)
+ zhuyin_cursor += g_utf8_strlen (sentence, -1);
} else {
size_t length = 0;
zhuyin_get_character_offset