Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
Sora233 committed May 24, 2023
1 parent 86b0287 commit b050266
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lsp/mmsg/writer.go
Expand Up @@ -240,11 +240,11 @@ func (m *MSG) ToMessage(target Target) []*message.SendingMessage {
}
if lastText != nil {
lastText.Content = strings.TrimRightFunc(lastText.Content, unicode.IsSpace)
}
if lastText.Content == "" {
m.Elements = lo.Filter(m.Elements, func(_ message.IMessageElement, index int) bool {
return index != lastIdx
})
if lastText.Content == "" {
m.Elements = lo.Filter(m.Elements, func(_ message.IMessageElement, index int) bool {
return index != lastIdx
})
}
}
}
if len(result) > 0 {
Expand Down

0 comments on commit b050266

Please sign in to comment.