Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: Source/WebCore/inspector/front-end/TextViewer.js

Issue 7037012: Merge 86683 - 2011-05-17 Pavel Feldman <pfeldman@google.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/TextViewer.js
===================================================================
--- Source/WebCore/inspector/front-end/TextViewer.js (revision 86685)
+++ Source/WebCore/inspector/front-end/TextViewer.js (working copy)
@@ -108,6 +108,9 @@
highlightLine: function(lineNumber)
{
+ if (typeof lineNumber !== "number" || lineNumber < 0)
+ return;
+
this._mainPanel.highlightLine(lineNumber);
},
@@ -406,6 +409,12 @@
{
var chunkNumber = this._chunkNumberForLine(lineNumber);
var oldChunk = this._textChunks[chunkNumber];
+
+ if (!oldChunk) {
+ console.error("No chunk for line number: " + lineNumber);
+ return;
+ }
+
if (oldChunk.linesCount === 1)
return oldChunk;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698