A way to check and see if a node exists or not

I think you should have written it like this

if camera != null and TargetNode != null