t8_cmesh_trees_get_tree returns NULL if not existing
In t8_cmesh_trees.h there are the following ToDo's: 284: /* TODO: This function returns NULL if the tree is not present. 285 * So far no error checking is done here. / 344: / TODO: This function returns NULL if the ghost is not present. 345 * So far no error checking is done here. */
Add to the description that NULL is returned, if tree does not exists. Do the error handling in the function, that calls t8_cmesh_trees_get_tree. Each function that uses t8_cmesh_trees_get_tree has to be checked, whether the tree is used. Add the check (!= NULL) to the functions that use the return value and add the information (returns NULL if not existing) to these functions that return the value of t8_cmesh_trees_get_tree. This is a recursive problem. The same procedure has to be done for each function that calls functions that return the value of t8_cmesh_trees_get_tree.