From: Gwanglim Lee Date: Fri, 8 May 2015 08:14:59 +0000 (+0900) Subject: add null check to avoid segmentation fault X-Git-Tag: accepted/tizen/common/20150511.125513^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34fa53cc6bd3edf92c33ae2c96a3e54ffa2d8d53;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git add null check to avoid segmentation fault Change-Id: I780d5a5bc87a29fab8728b9df4746f6178ae0897 --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index f66bdeb..cbf8f3f 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -93,7 +93,7 @@ _e_text_input_method_context_cb_string_commit(struct wl_client *client EINA_UNUS return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_commit_string(context->model->resource, serial, text); } @@ -111,7 +111,7 @@ _e_text_input_method_context_cb_preedit_string(struct wl_client *client EINA_UNU return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_preedit_string(context->model->resource, serial, text, commit); } @@ -129,7 +129,7 @@ _e_text_input_method_context_cb_preedit_styling(struct wl_client *client EINA_UN return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_preedit_styling(context->model->resource, index, length, style); } @@ -147,7 +147,7 @@ _e_text_input_method_context_cb_preedit_cursor(struct wl_client *client EINA_UNU return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_preedit_cursor(context->model->resource, cursor); } @@ -165,7 +165,7 @@ _e_text_input_method_context_cb_surrounding_text_delete(struct wl_client *client return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_delete_surrounding_text(context->model->resource, index, length); } @@ -183,7 +183,7 @@ _e_text_input_method_context_cb_cursor_position(struct wl_client *client EINA_UN return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_cursor_position(context->model->resource, index, anchor); } @@ -201,7 +201,7 @@ _e_text_input_method_context_cb_modifiers_map(struct wl_client *client EINA_UNUS return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_modifiers_map(context->model->resource, map); } @@ -218,7 +218,7 @@ _e_text_input_method_context_cb_keysym(struct wl_client *client EINA_UNUSED, str return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_keysym(context->model->resource, serial, time, sym, state, modifiers); } @@ -273,7 +273,7 @@ _e_text_input_method_context_cb_language(struct wl_client *client EINA_UNUSED, s return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_language(context->model->resource, serial, language); } @@ -291,7 +291,7 @@ _e_text_input_method_context_cb_text_direction(struct wl_client *client EINA_UNU return; } - if (context->model) + if ((context->model) && (context->model->resource)) wl_text_input_send_text_direction(context->model->resource, serial, direction); }