From b6437b5a4c52bceb8032b00b474c2aa0ced69575 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 28 Nov 2014 21:54:49 -0500 Subject: [PATCH] safe check --- routers/user/social.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/user/social.go b/routers/user/social.go index a8a94a5c4..913fc094f 100644 --- a/routers/user/social.go +++ b/routers/user/social.go @@ -51,6 +51,10 @@ func SocialSignIn(ctx *middleware.Context) { ctx.Handle(500, fmt.Sprintf("UserInfo(%s)", name), err) return } + if len(ui.Identity) == 0 { + ctx.Handle(404, "no identity is presented", errors.New(name)) + return + } log.Info("social.SocialSignIn(social login): %s", ui) oa, err := models.GetOauth2(ui.Identity)