diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index d261d39953..e320795d5f 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -9226,6 +9226,7 @@ _ui_buffer_get(Ecore_Evas_Selection_Buffer buffer) void _register_selection_changed(Efl_Ui_Selection *selection) { + if (!selection) return; ELM_WIN_DATA_GET(efl_provider_find(selection, EFL_UI_WIN_CLASS), pd); eina_array_push(pd->planned_changes, selection); diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c index ded6e10503..2c6578ef82 100644 --- a/src/lib/elementary/elm_cnp.c +++ b/src/lib/elementary/elm_cnp.c @@ -127,6 +127,18 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Eina_Array *tmp; unsigned char *mem_buf = NULL; + if (!obj) + { + ERR("elm_cnp_selection_set() passed NULL object"); + return EINA_FALSE; + } + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); + if (!ee) + { + ERR("elm_cnp_selection_set() can't fine ecore_evas for obj %p", obj); + return EINA_FALSE; + } + if (format == ELM_SEL_FORMAT_TEXT && ((char*)buf)[buflen - 1] != '\0') { mem_buf = eina_memdup((unsigned char *)buf, buflen, EINA_TRUE); @@ -139,8 +151,6 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, data.len = buflen; } - ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); - if (format == ELM_SEL_FORMAT_IMAGE) { tmp = _elm_sel_from_content_to_mime_type(buf, buflen);