When throwing an exception from a User Defined Function (UDF) in c-treeACE SQL the server could fail due to a NULL pointer reference, as the UDF had thrown the exception before the return value was allocated. Complete exception handling has been put in place to prevent this situation.