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 4093841
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private final class DelegatingReporter(
}

private def getActions(pos: Position, pos1: xsbti.Position, msg: String): List[Action] =
if (pos.isRange) Nil
if ((pos eq null) || pos.isRange) Nil //can be null when a message is not related to any file (e.g. with `-X/-Y/-V/-W` compiler options)
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 4093841

Please sign in to comment.