瀏覽代碼

teams: only write error message if error

Hugo Häggmark 6 年之前
父節點
當前提交
074ebf0f48
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      pkg/api/team.go

+ 4 - 2
pkg/api/team.go

@@ -24,8 +24,10 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
 			TeamId:     cmd.Result.Id,
 			Permission: int64(m.PERMISSION_ADMIN),
 		}
-		err := bus.Dispatch(&addMemberCmd)
-		c.Logger.Error("Could not add creator to team.", "error", err)
+
+		if err := bus.Dispatch(&addMemberCmd); err != nil {
+			c.Logger.Error("Could not add creator to team.", "error", err)
+		}
 	}
 
 	return JSON(200, &util.DynMap{