The problem here is that when the Laser node doesn’t exist, that get_node() call returns null. When that happens, you’re then trying to ask for the parent of a null node, which doesn’t make sense and generates the error.
There are likely better ways to solve this, but an easy way would be something like: