fix: add err handler for notifyRobot

This commit is contained in:
rainzm
2020-11-17 16:34:12 +08:00
parent a4dc42e69a
commit 36dec7baa0
+7 -1
View File
@@ -333,7 +333,13 @@ func notifyRobot(ctx context.Context, robot string, recipientId []string, isGrou
if err != nil {
return err
}
jarray, _ := result.Get("types")
if result == nil {
return nil
}
jarray, err := result.Get("types")
if err != nil {
return err
}
cTypes := jarray.(*jsonutils.JSONArray).GetStringArray()
for _, ct := range cTypes {
RawNotifyWithCtx(ctx, recipientId, isGroup, npk.TNotifyChannel(ct), priority, event, data)