From 3d61bbde7ad04520eac81056ea413b5b200821c1 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 12 Dec 2020 20:45:39 +0900 Subject: [PATCH] Fix defect detected by static analysis tool Change-Id: I27b5ec5443de628d116b94c4fb0001a673df2d1c Signed-off-by: Jihoon Kim --- src/ise.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ise.cpp b/src/ise.cpp index aa817e7..f2bd7da 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -2619,13 +2619,15 @@ static void set_ime_size(bool floating_mode, ISE_CANDIDATE_REQUEST candidate_req } break; case ISE_CANDIDATE_REQ_SHOW: - ui->set_custom_starting_coordinates(0, candidate->get_height()); - if (g_input_panel_show || g_candidate_more_view) { - size_portrait.height += candidate->get_height(); - size_landscape.height += candidate->get_height(); - } else { - size_portrait.height = candidate->get_height(); - size_landscape.height = candidate->get_height(); + if (candidate) { + ui->set_custom_starting_coordinates(0, candidate->get_height()); + if (g_input_panel_show || g_candidate_more_view) { + size_portrait.height += candidate->get_height(); + size_landscape.height += candidate->get_height(); + } else { + size_portrait.height = candidate->get_height(); + size_landscape.height = candidate->get_height(); + } } break; case ISE_CANDIDATE_REQ_HIDE: -- 2.7.4