Skip to content

Commit

Permalink
fix: nullptr reference when process key event esc or backspace, if pr…
Browse files Browse the repository at this point in the history
…edict db not loaded
  • Loading branch information
fxliang authored and lotem committed Jan 17, 2024
1 parent 7bcbe57 commit 4f2b3b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Predictor::~Predictor() {
}

ProcessResult Predictor::ProcessKeyEvent(const KeyEvent& key_event) {
if (!engine_)
return kNoop;
auto keycode = key_event.keycode();
if (keycode == XK_BackSpace || keycode == XK_Escape) {
last_action_ = kDelete;
Expand Down

0 comments on commit 4f2b3b9

Please sign in to comment.