Skip to content

Commit

Permalink
bugfix: Future filter error during connecting to build server
Browse files Browse the repository at this point in the history
If we get to the state that selected build tool is no longer available, Metals would crash.
This happend in `MetalsLspService.buildTool` if `BuildToolSelector.checkForChosenBuildTool` returned Future(None)
  • Loading branch information
jkciesluk committed Oct 18, 2023
1 parent ef544a6 commit f6ae347
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1957,11 +1957,10 @@ class MetalsLspService(
case Nil => Future(None)
case buildTools =>
for {
Some(buildTool) <- buildToolSelector.checkForChosenBuildTool(
buildTool <- buildToolSelector.checkForChosenBuildTool(
buildTools
)
if isCompatibleVersion(buildTool)
} yield Some(buildTool)
} yield buildTool.filter(isCompatibleVersion)
}
}

Expand Down

0 comments on commit f6ae347

Please sign in to comment.