title: Detect that a joint doesn't have an connected body anymore
body: <p>I have a dynamically generated list of <code>GameObjects</code> that are connected to eachother using <code>SpringJoint</code>, later I need to destroy some of the <code>GameObject</code>'s but the <code>SprintJoint</code> connection to the recently destroyed <code>GameObject</code> remains in the other objects, in the Unity Inspector I can see that the connected body appears as missing as expected since the object doesn't exists anymore:</p>
  <p><a href="https://i.stack.imgur.com/I9aCJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9aCJ.png" alt="enter image description here" /></a></p>
  <p>But I'm trying to detect this from code so I can delete the <code>SprintJoint</code> entirely, I'm currently using this code but seems like <code>connectedBody</code> is returning a <code>RigidBody</code> even if the parent object doesn't exists anymore:</p>
  <pre><code>foreach (GameObject cell in combined)
  {
      SpringJoint joint = cell.GetComponent&lt;SpringJoint&gt;();
      if (joint.connectedBody == null)
          Destroy(joint);
  }
  </code></pre>
  <p>I also tried checking if the <code>GameObject</code> exists like this:</p>
  <pre><code>foreach (GameObject cell in combined)
  {
      SpringJoint joint = cell.GetComponent&lt;SpringJoint&gt;();
      Rigidbody rg = joint.connectedBody;
      if (rg.gameObject == null)
          Destroy(joint);
  }
  </code></pre>
  <p>What's the correct way of checking if the connected body doesn't exists anymore?</p>