title: Autodesk Forge Viewer gives error when loading a different document
body: <p>I am using the Autodesk Forge Viewer v7.18.0 along with a custom extension that uses the new SceneBuilder to add 3d Geometries in the Viewer itself.</p>
  <p>While using this, when the user switches from one file to another, basically loading a different SVF file, we remove all the fragments in the modelBuilder created by the SceneBuilder and then call the</p>
  <pre class="lang-js prettyprint-override"><code>Autodesk.Viewing.Document.load(fileUrn, onDocumentLoadSuccess, onDocumentLoadFailure)
  </code></pre>
  <p>and in the <code>onDocumentLoadSuccess()</code>, we call the function</p>
  <pre class="lang-js prettyprint-override"><code>//The viewable is fetched from the file based on certain criteria
  viewer.loadDocumentNode(doc, viewable, loadOptions) 
  </code></pre>
  <p>This on the first load of a new file gives the following error and I am not sure how to fix that:</p>
  <pre class="lang-js prettyprint-override"><code>Uncaught TypeError: Cannot read property 'dispatchEvent' of null
      at f.dispose (FragmentList.js:782)
      at u.dtor (RenderModel.js:144)
      at H.unloadModel (Viewer3DImpl.js:2763)
      at H.unloadCurrentModel (Viewer3DImpl.js:2925)
      at T.Z.tearDown (Viewer3D.js:800)
      at T.tearDown (GuiViewer3D.js:180)
      at T.Z.loadDocumentNode (Viewer3D.js:1713)
      at onDocumentLoadSuccess (eval at &lt;anonymous&gt; (jquery.min.js:1), &lt;anonymous&gt;:142:12)
      at Function.p (Document.js:146)
      at l (Xhr.js:564)
  </code></pre>
  <p>The same error doesn't show up if the new file is loaded again and it works as expected.</p>
  <p>Any help is highly appreciated.</p>