diff --git a/io/src/main/scala/sbt/internal/io/SourceModificationWatch.scala b/io/src/main/scala/sbt/internal/io/SourceModificationWatch.scala index 52584b98..cb92c244 100644 --- a/io/src/main/scala/sbt/internal/io/SourceModificationWatch.scala +++ b/io/src/main/scala/sbt/internal/io/SourceModificationWatch.scala @@ -67,7 +67,10 @@ private[sbt] object SourceModificationWatch { private def expandEvent(event: (Path, WatchEvent[_])): (Path, WatchEvent.Kind[Path]) = { event match { case (base, ev) => - val fullPath = base.resolve(ev.context().asInstanceOf[Path]) + val fullPath = Option(ev.context().asInstanceOf[Path]) match { + case Some(path) => base.resolve(path) + case None => base + } val kind = ev.kind().asInstanceOf[WatchEvent.Kind[Path]] (fullPath, kind) }