Index: runtime/observatory/lib/src/elements/script_inset.dart |
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart |
index 791534fdfbd3e32b4221cc08ffe260251626827e..66b125caa62926df5f17d04278a80a9b723f9f9f 100644 |
--- a/runtime/observatory/lib/src/elements/script_inset.dart |
+++ b/runtime/observatory/lib/src/elements/script_inset.dart |
@@ -439,8 +439,12 @@ class ScriptInsetElement extends ObservatoryElement { |
? script.tokenToLine(currentPos) |
: null); |
_currentCol = (currentPos != null |
- ? (script.tokenToCol(currentPos) - 1) // make this 0-based. |
+ ? (script.tokenToCol(currentPos)) |
: null); |
+ if (_currentCol != null) { |
+ _currentCol--; // make this 0-based. |
+ } |
+ |
_endLine = (endPos != null |
? script.tokenToLine(endPos) |
: script.lines.length + script.lineOffset); |
@@ -564,6 +568,10 @@ class ScriptInsetElement extends ObservatoryElement { |
var table = new DivElement(); |
table.classes.add("sourceTable"); |
+ if (_startLine == null || _endLine == null) { |
+ return table; |
+ } |
+ |
annotationsCursor = 0; |
int blankLineCount = 0; |