Fix plot detail view to check for species

The view was crashing when trees did not have species because it was
trying to reference tree.species.itree_code without first checking
tree.species.

Fixes #239