Skip to content

Commit

Permalink
Fix crash in TaskScanner when encountering NoPosition.
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos committed Jul 31, 2012
1 parent 1101a2e commit f95b2ce
Showing 1 changed file with 11 additions and 9 deletions.
Expand Up @@ -77,15 +77,17 @@ abstract class BuildReporter(private[buildmanager] val project0: ScalaProject, s
}

override def comment(pos : Position, msg : String) {
val tasks = taskScanner.extractTasks(msg, pos)
for (TaskScanner.Task(tag, msg, priority, pos) <- tasks if pos.isDefined) {
val source = pos.source
val start = pos.startOrPoint
val length = pos.endOrPoint-start
source.file match {
case EclipseResource(i : IFile) =>
FileUtils.task(i, tag, msg, priority, start, length, pos.line, null)
case _ =>
if (pos.isDefined) {
val tasks = taskScanner.extractTasks(msg, pos)
for (TaskScanner.Task(tag, msg, priority, pos) <- tasks if pos.isDefined) {
val source = pos.source
val start = pos.startOrPoint
val length = pos.endOrPoint - start
source.file match {
case EclipseResource(i: IFile) =>
FileUtils.task(i, tag, msg, priority, start, length, pos.line, null)
case _ =>
}
}
}
}
Expand Down

0 comments on commit f95b2ce

Please sign in to comment.