bu5hm4n pushed a commit to branch master.

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

commit 6c251b2d0163a19f4928c3388fb8e675d8f00bdc
Author: Marcel Hollerbach <[email protected]>
Date:   Mon Feb 17 13:55:33 2020 +0100

    eina_array: interpret the count of a NULL array as 0
    
    this makes the usage way more convinient.
    
    Reviewed-by: Xavi Artigas <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11373
---
 src/lib/eina/eina_inline_array.x | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/eina/eina_inline_array.x b/src/lib/eina/eina_inline_array.x
index d750782ce8..8367d61e7b 100644
--- a/src/lib/eina/eina_inline_array.x
+++ b/src/lib/eina/eina_inline_array.x
@@ -89,6 +89,7 @@ eina_array_count_get(const Eina_Array *array)
 static inline unsigned int
 eina_array_count(const Eina_Array *array)
 {
+   if (!array) return 0;
    return array->count;
 }
 

-- 


Reply via email to