InputHandler // Fix a fatal error with validity check.

This commit is contained in:
ShikiSuen 2023-05-12 20:44:22 +08:00
parent 8d8c0246fe
commit a81fe379c2
1 changed files with 8 additions and 2 deletions

View File

@ -118,7 +118,10 @@ extension InputHandler {
//
// Megrez
if !input.isInvalid, !compositor.insertKey(readingKey) {
if input.isInvalid {
delegate.callError("22017F76: 不合規的按鍵輸入。")
return true
} else if !compositor.insertKey(readingKey) {
delegate.callError("3CF278C9: 得檢查對應的語言模組的 hasUnigramsFor() 是否有誤判之情形。")
return true
}
@ -259,7 +262,10 @@ extension InputHandler {
//
// Megrez
if !input.isInvalid, !compositor.insertKey(calligrapher) {
if input.isInvalid {
delegate.callError("BFE387CC: 不合規的按鍵輸入。")
return true
} else if !compositor.insertKey(calligrapher) {
delegate.callError("61F6B11F: 得檢查對應的語言模組的 hasUnigramsFor() 是否有誤判之情形。")
return true
}