From e5ee3deafdf3abcdc34e79579c25278e1804000d Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 31 Mar 2013 22:14:26 -0700 Subject: [PATCH] cmArray.c: When the array handle is invalid cmArrayCount() now returns 0 instead of throwing an error. --- cmArray.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmArray.c b/cmArray.c index 08211e0..961b3c1 100644 --- a/cmArray.c +++ b/cmArray.c @@ -95,6 +95,9 @@ unsigned cmArrayExpandCount( cmArrayH_t h ) unsigned cmArrayCount( cmArrayH_t h ) { + if( cmArrayIsValid(h) == false ) + return 0; + cmAr_t* p = _cmArHandleToPtr(h); return p->cur_cnt; }