Permalink
Browse files

Fix: check for null, since absent delimiter is not an empty string, b…

…ut null :-(
  • Loading branch information...
1 parent 313830f commit 796ee57d5aef8aa8a05be7664884b4dbc207ee6d @Oblosys committed Jul 18, 2012
@@ -131,8 +131,9 @@ public Location(IProject project, String fileName, int startLin, int startCol, i
if (lineTracker != null) {
try {
//System.err.println("Initial span: "+startLine+":"+startColumn+" to "+endLine+":"+endColumn);
+ String delimiter = lineTracker.getLineDelimiter(startLine-1); // apparently this can return null
int lineLength = lineTracker.getLineLength(startLine-1 /*LineTracker is 0 based*/ )
- - lineTracker.getLineDelimiter(startLine-1).length(); // subtract the delimiter length
+ - (delimiter == null ? 0 : delimiter.length()); // subtract the delimiter length
if (startLine==endLine && startColumn==endColumn) { // span is empty
if (startColumn < lineLength) { // not past the last character, so we can extend to the right.
endColumn += 1;

0 comments on commit 796ee57

Please sign in to comment.