githubmerge: make public name/email access of users more robust.
authorJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 20:45:12 +0000 (16:45 -0400)
committerJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 20:45:12 +0000 (16:45 -0400)
Recent changes in github API or in the @jpages account broke the script.

Signed-off-by: Jean Privat <jean@pryen.org>

contrib/github_merge.nit

index 3a98c10..52afa49 100644 (file)
@@ -68,8 +68,8 @@ redef class GithubCurl
                var res = new Array[String]
                for l in logins do
                        var u = get_and_check("https://api.github.com/users/{l}").json_as_map
-                       if not u.has_key("name") then
-                               print "No public name for user {l}"
+                       if not u.has_key("name") or u["name"] == null or not u.has_key("email")or u["email"] == null then
+                               print "No public name/email for user {l}"
                                continue
                        end
                        var r = "{u["name"].to_s} <{u["email"].to_s}>"