If we don't pass NULL to the length argument it makes C code write the length at random places in memory and bad things happens.
This allows you to avoid ugly calls like "NewArray (null, some_array)" when you want the child type to be determined by the first element of the children array. Also throw specific exceptions when both type and children parameters would be null.