title: "target is undefined" in d3.force implementation
body: <p>I am new to coding and recently began testing d3 to generate a force directed graph where nodes are linked by IDs instead of index.</p>
  
  <p>I successfully implemented <a href="https://stackoverflow.com/questions/23986466/d3-force-layout-linking-nodes-by-name-instead-of-index">this solution</a>. However, this works only when my link array includes defined source or target IDs. When undefined IDs are included (the JSON data I am using inevitably contains a certain amount of them), I get this error :</p>
  
  <pre><code>TypeError: o.target is undefined
  </code></pre>
  
  <p>I reproduced the error in this <a href="https://jsfiddle.net/e266vgq9/1/" rel="nofollow noreferrer">fiddle</a>.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thank you,
  Davide</p>