first i would try to make sure blank records do not happen with dd rules and worst case you can override save_main_file to check at a last resort

if you want to check all the records that could prevent a delete you can loop all child tables. DD has Client_File_Count and Client_File