Skip to content

Commit

Permalink
avoid trying to send message when no receiver is set
Browse files Browse the repository at this point in the history
Fixes #26
  • Loading branch information
normen committed Dec 5, 2020
1 parent 6a97d6d commit 49718ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ func EnterCommand(key tcell.Key) {
textInput.SetText("")
return
}
if currentReceiver.Id == "" {
PrintText("no receiver")
textInput.SetText("")
return
}
// no command, send as message
msg := messages.Command{
Name: "send",
Expand Down

0 comments on commit 49718ac

Please # to comment.