frontend: improve empty result handling

This commit is contained in:
Lan Tian
2020-06-29 15:04:32 +08:00
parent 47d7168718
commit fc098c7d50

View File

@@ -145,7 +145,10 @@ func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) {
}
commandResult = strings.TrimSpace(commandResult)
if len(commandResult) > 0 {
if len(commandResult) < 0 {
commandResult = "empty result"
}
// Create a JSON response
w.Header().Add("Content-Type", "application/json")
response := &tgWebhookResponse{
@@ -162,5 +165,4 @@ func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) {
}
// println(string(data))
w.Write(data)
}
}