This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/31/head
in repository efl.

View the commit online.

commit 80e905aeacf51efb385fe5f0d3754433a359e9ef
Author: dimmus <dmitri.chudi...@gmail.com>
AuthorDate: Mon Jun 3 18:47:01 2024 +0500

    efl_ui_textbox: fix sd->scroller=null error
    
    Can be called by efl_ui_widget_scroll_hold_{pop, push} from another  widget (ex., efl_ui_slider) without _efl_ui_textbox_scrollable_set()  invocation with undefined sd->scroller here as the result.  So, check if sd->scroll is true to avoid this.
    
    The same for *_freeze_set.
---
 src/lib/elementary/efl_ui_textbox.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index b58b3a2c08..79055ecad7 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -3349,8 +3349,15 @@ _efl_ui_textbox_efl_ui_scrollable_scroll_hold_get(const Eo *obj EINA_UNUSED, Efl
 EOLIAN static void
 _efl_ui_textbox_efl_ui_scrollable_scroll_hold_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool hold)
 {
-   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
-   efl_ui_scrollable_scroll_hold_set(sd->scroller, !!hold);
+   /* Can be called by efl_ui_widget_scroll_hold_{pop, push} from another
+    * widget (ex., efl_ui_slider) without _efl_ui_textbox_scrollable_set() 
+    * invocation with undefined sd->scroller here as the result. 
+    * So, check if sd->scroll is true to avoid this. */
+   if(sd->scroll)
+   {
+      EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+      efl_ui_scrollable_scroll_hold_set(sd->scroller, !!hold);
+   }
 }
 
 EOLIAN static Eina_Bool
@@ -3363,8 +3370,12 @@ _efl_ui_textbox_efl_ui_scrollable_scroll_freeze_get(const Eo *obj EINA_UNUSED, E
 EOLIAN static void
 _efl_ui_textbox_efl_ui_scrollable_scroll_freeze_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool freeze)
 {
-   EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
-   efl_ui_scrollable_scroll_freeze_set(sd->scroller, !!freeze);
+   /* The same as for hold_set. See comments above. */
+   if(sd->scroll)
+   {
+      EINA_SAFETY_ON_NULL_RETURN(sd->scroller);
+      efl_ui_scrollable_scroll_freeze_set(sd->scroller, !!freeze);
+   }
 }
 
 EOLIAN static void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to