summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2016-12-05 16:53:42 +0100
committerStefan Schmidt <stefan@osg.samsung.com>2016-12-05 17:07:39 +0100
commit6f847f1f55820498d2a309524e3af0cc6bedc73f (patch)
treec1cb5ef5f7d5b26efa87a5c09a43fdee34e5faa1
parent6cf11650c451a93fd6fbd8c3424d2f724791109d (diff)
downloadefl-6f847f1f55820498d2a309524e3af0cc6bedc73f.tar.gz
elm: multibuttomentry: check if value is valid before we access it
The ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN will access 'it' here before we check it is NULL. Reverse the order of these checks. CID: 1365324, 1365323
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index fafe7b3fa2..bdd5f6b833 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -551,9 +551,10 @@ _on_item_focused(void *data,
void *event_info EINA_UNUSED)
{
Elm_Multibuttonentry_Item_Data *it = data;
+ if (!it) return;
+
ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
- if (!it) return;
sd->selected_it = it;
}
@@ -563,9 +564,10 @@ _on_item_unfocused(void *data,
void *event_info EINA_UNUSED)
{
Elm_Multibuttonentry_Item_Data *it = data;
+ if (!it) return;
+
ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
- if (!it) return;
sd->selected_it = NULL;
elm_layout_signal_emit(VIEW(it), "elm,state,unfocused", "elm");
}