Use a node to filter out null elements in a script.
You can debug a script by watching the output of each Dynamo node. If the node has a large list as output, where most elements are null, you can use the List.Clean Dynamo node to filter out the null elements.
You can also click on the script nodes to highlight the geometry of the elements that passed the previous filter node.
Placing the connections in Dynamo will draw boxes at the locations of each successfully placed connections.