From a5a50f79cd402adc7296baac8ce1acb7ddb26fea Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 25 Jul 2019 11:22:38 -0400 Subject: [PATCH] Catch any JSON errors --- chatOut.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chatOut.go b/chatOut.go index 8ccc69a..5397ffb 100644 --- a/chatOut.go +++ b/chatOut.go @@ -17,7 +17,9 @@ func chatAPIOut(keybasePath string, c ChatAPI) (ChatAPI, error) { } var r ChatAPI - json.Unmarshal(cmdOut, &r) + if err := json.Unmarshal(cmdOut, &r); err != nil { + return ChatAPI{}, err + } return r, nil }