eunue pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=86de58676f6a90f1883560e0133ccf1154f31461

commit 86de58676f6a90f1883560e0133ccf1154f31461
Author: Jaeun Choi <jaeun12.c...@samsung.com>
Date:   Wed Jan 23 20:57:09 2019 +0900

    efl_ui_pager: add missing conditions in pack before/after function
    
    the functions should return if the 'existing' object is not in the content 
list
---
 src/lib/elementary/efl_ui_pager.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_pager.c 
b/src/lib/elementary/efl_ui_pager.c
index c9df2f7317..e89be99720 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -451,9 +451,9 @@ _efl_ui_pager_efl_pack_linear_pack_before(Eo *obj 
EINA_UNUSED,
 {
    if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE;
 
-   int index;
+   int index = eina_list_data_idx(pd->content_list, (void *)existing);
+   if (index == -1) return EINA_FALSE;
 
-   index = eina_list_data_idx(pd->content_list, (void *)existing);
    pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, 
existing);
 
    pd->cnt += 1;
@@ -480,9 +480,9 @@ _efl_ui_pager_efl_pack_linear_pack_after(Eo *obj 
EINA_UNUSED,
 {
    if (!EINA_DBL_EQ(pd->curr.pos, 0.0)) return EINA_FALSE;
 
-   int index;
+   int index = eina_list_data_idx(pd->content_list, (void *)existing);
+   if (index == -1) return EINA_FALSE;
 
-   index = eina_list_data_idx(pd->content_list, (void *)existing);
    pd->content_list = eina_list_append_relative(pd->content_list, subobj, 
existing);
 
    pd->cnt += 1;

-- 


Reply via email to