diff --git a/src/Autoarr/Autoarr_define.h b/src/Autoarr/Autoarr_define.h index 6c7df17..ec54f7a 100644 --- a/src/Autoarr/Autoarr_define.h +++ b/src/Autoarr/Autoarr_define.h @@ -64,6 +64,8 @@ void ____Autoarr_##type##_freeWithMembers(void* ar){ \ \ type* __Autoarr_##type##_toArray(Autoarr_##type* ar){ \ u32 length=Autoarr_length(ar); \ + if(length==0) \ + return NULL; \ type* array=malloc(length * sizeof(type)); \ for(u32 i=0; i