Web Inspector: Linkifier.reset throw an exception if it is called after reset of...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2011 16:40:44 +0000 (16:40 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2011 16:40:44 +0000 (16:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69756

Reviewed by Yury Semikhatsky.

* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.reset):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97065 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

index bb1d4fb8a52860b14b9a012423636b739337ab07..33585fdaa29d97aafd929bec22944cd132966f81 100644 (file)
@@ -1,3 +1,13 @@
+2011-10-10  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: Linkifier.reset throw an exception if it is called after reset of debuggerPresentationModel.
+        https://bugs.webkit.org/show_bug.cgi?id=69756
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.reset):
+
 2011-09-28  Pavel Podivilov  <podivilov@chromium.org>
 
         Web Inspector: RawSourceCode could be mapped to multiple sources.
 2011-09-28  Pavel Podivilov  <podivilov@chromium.org>
 
         Web Inspector: RawSourceCode could be mapped to multiple sources.
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 = {};
     },