Change how error message appears when searching for thermo data in a tree.

Previously, the last iteration of the loop would continue even if the node is
'None' and look for node.data. This returned a NoneType error rather than throwing
 the exception that was intended.