Skip to content

Commit

Permalink
fix NPE in DelegatingReporter.scala
Browse files Browse the repository at this point in the history
fixes #1245
  • Loading branch information
unkarjedy committed Sep 5, 2023
1 parent a03b3c1 commit 5d0a81a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ private final class DelegatingReporter(
}

private def getActions(pos: Position, pos1: xsbti.Position, msg: String): List[Action] =
if (pos.isRange) Nil
if (pos == null) Nil //can be null when a message is not related to any file (e.g. with `-X/-Y/-V/-W` compiler options)
else if (pos.isRange) Nil
else if (msg.contains("procedure syntax is deprecated")) {
if (msg.contains("add `: Unit =`")) {
val edit = workspaceEdit(List(textEdit(pos1, ": Unit = ")))
Expand Down

0 comments on commit 5d0a81a

Please sign in to comment.