Skip to content

Commit

Permalink
Merge pull request #140 from oneill/handle-null-watchevent-context
Browse files Browse the repository at this point in the history
Handle null WatchEvent context
  • Loading branch information
eed3si9n authored Apr 7, 2018
2 parents b35ee7d + 881e835 commit 471cf7b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 471cf7b

Please sign in to comment.