From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
I found even if not create the list, the function ListNumItems() can still return back a zero. This will make a confusing because the return value cannot instruct an error of that the list has not been created.
You can use the toolbox macro VALIDATE_LIST (list) before trying to access the list. The macro is defined in toolbox.h and returns 0 if the list passed is not a valid one. See the code for ListNumItems in toolbox.c file.
Having said this, that function could be modified so that it returns -1 in case the list is not valid instead of 0, which is a valid return value for the function. You can modify it on your own and recompile the toolbox library.