Bug 374989 - Scrolling in the editor for some files got exception. 
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js b/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js
index 12d4bb8..e5466d3 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js
@@ -728,7 +728,7 @@
 				ranges = [];

 			}

 			var mergedStyle;

-			for (var i=0; i<ranges.length; i++) {

+			for (var i=0; i<ranges.length && styleRange; i++) {

 				var range = ranges[i];

 				if (styleRange.end <= range.start) { break; }

 				if (styleRange.start >= range.end) { continue; }