Edi_editor.c: Fix segfault

Fix a segfault when opening a file in a new window and then pressing a key without any other interaction. Simply check if item is null and return without action if it is.
This commit is contained in:
Kelly Wilson 2015-02-01 09:09:25 -07:00
parent 68679607e6
commit 22cfc584d6
1 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,10 @@ _smart_cb_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
item = edi_mainview_item_current_get();
if (!item)
return;
content = elm_object_item_content_get(item->view);
editor = (Edi_Editor *)evas_object_data_get(content, "editor");