projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Additional checks to keep zero-length messages from crashing the indexer.
[citadel.git]
/
libcitadel
/
lib
/
array.c
diff --git
a/libcitadel/lib/array.c
b/libcitadel/lib/array.c
index b30e9ebf209add27aeea65760844064e6eee64ed..e6d26aa231670fcdd6a7c12ef2193b84619a0363 100644
(file)
--- a/
libcitadel/lib/array.c
+++ b/
libcitadel/lib/array.c
@@
-68,6
+68,10
@@
void *array_get_element_at(Array *arr, int index) {
// Return the number of elements in an array
int array_len(Array *arr) {
+ if (!arr) {
+ return(0);
+ }
+
return arr->num_elements;
}