Skip to content

Commit 2e219a1

Browse files
authored
[diagnostics] rel.location can be null (#134)
* Use Safety.let instead of null check
1 parent c33ca4c commit 2e219a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/haxeLanguageServer/features/haxe/DiagnosticsFeature.hx

+4-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ class DiagnosticsFeature {
220220
message: hxDiag.kind.getMessage(doc, hxDiag.args, range),
221221
data: {kind: hxDiag.kind},
222222
relatedInformation: hxDiag.relatedInformation?.map(rel -> {
223-
location: {
224-
uri: rel.location.file.toUri(),
225-
range: rel.location.range,
226-
},
223+
location: Safety.let(rel.location, location -> {
224+
uri: location.file.toUri(),
225+
range: location.range,
226+
}),
227227
message: convertIndentation(rel.message, rel.depth)
228228
})
229229
}

0 commit comments

Comments
 (0)