Web Inspector: Linkifier.reset throw an exception if it is called after reset of...
[WebKit-https.git] / Source / WebCore / inspector / front-end / DebuggerPresentationModel.js
index c11173b6d43f5c93cff7328c1a7b43355c7839b5..389a3ed73acee16c6505f9f90b7bd7dfb61eabe1 100644 (file)
@@ -610,8 +610,10 @@ WebInspector.DebuggerPresentationModel.Linkifier.prototype = {
 
     reset: function()
     {
 
     reset: function()
     {
-        for (var id in this._anchorsForRawSourceCode)
-            this._model._rawSourceCode[id].removeEventListener(WebInspector.RawSourceCode.Events.SourceMappingUpdated, this._updateSourceAnchors, this);
+        for (var id in this._anchorsForRawSourceCode) {
+            if (this._model._rawSourceCode[id]) // In case of navigation the list of rawSourceCodes is empty.
+                this._model._rawSourceCode[id].removeEventListener(WebInspector.RawSourceCode.Events.SourceMappingUpdated, this._updateSourceAnchors, this);
+        }
         this._anchorsForRawSourceCode = {};
     },
 
         this._anchorsForRawSourceCode = {};
     },