Skip to content

Commit

Permalink
Merge pull request #1246 from unkarjedy/fix-1245
Browse files Browse the repository at this point in the history
fix NPE in DelegatingReporter.scala
  • Loading branch information
eed3si9n committed Sep 6, 2023
2 parents a03b3c1 + 1220b2b commit 196376e
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 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 196376e

Please sign in to comment.