From 67c2881914a0242fc14ec7d6877782771b75800c Mon Sep 17 00:00:00 2001 From: fxliang Date: Wed, 19 Jun 2024 17:47:51 +0800 Subject: [PATCH] fix: dumps happen when processing backspace or escape, if predict db is not loaded successfully. incomplete fix of #20 (#26) --- src/predictor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/predictor.cc b/src/predictor.cc index ec12ff8..84190fc 100644 --- a/src/predictor.cc +++ b/src/predictor.cc @@ -30,7 +30,7 @@ Predictor::~Predictor() { } ProcessResult Predictor::ProcessKeyEvent(const KeyEvent& key_event) { - if (!engine_) + if (!engine_ || !predict_engine_) return kNoop; auto keycode = key_event.keycode(); if (keycode == XK_BackSpace || keycode == XK_Escape) {