raster pushed a commit to branch master.

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

commit b8a760ed58993a84458eb9eda6170ee1a0f76036
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Jul 21 17:02:43 2017 +0900

    efreet - dont complain if INTERNAL x extension hash of desktop is NULL
    
    asking for an x- field from a desktop shouldnt result in null safety
    checks IF the x hash is null - it's fine if it's null - that field
    just doesn't eixst. if other fields were in the x hash but the desired
    one wasn't it'd not complain, so why complain if there is just no x
    hash?
---
 src/lib/efreet/efreet_desktop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index 78d0f514cb..4a4f4d1564 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -534,8 +534,8 @@ efreet_desktop_x_field_get(Efreet_Desktop *desktop, const 
char *key)
     const char *ret;
 
     EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, NULL);
-    EINA_SAFETY_ON_NULL_RETURN_VAL(desktop->x, NULL);
     EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), NULL);
+    if (!desktop->x) return NULL;
 
     eina_lock_take(&_lock);
     ret = eina_hash_find(desktop->x, key);
@@ -557,7 +557,7 @@ efreet_desktop_x_field_del(Efreet_Desktop *desktop, const 
char *key)
     Eina_Bool ret;
     EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, EINA_FALSE);
     EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), EINA_FALSE);
-    EINA_SAFETY_ON_NULL_RETURN_VAL(desktop->x, EINA_FALSE);
+    if (!desktop->x) return EINA_FALSE;
 
     eina_lock_take(&_lock);
     ret = eina_hash_del_by_key(desktop->x, key);

-- 


Reply via email to