Any way to judge whether the click point is on a node or on background?

I tried to use “targetObject” to get the part where input event happens. But I don’t know how to judge this target is part of a node. How can I get the node from the targetObject?

If the event were in the diagram background there would be no GraphObject, so the value would be null.