From a6d60718e0ce7bb4898383f343dd85838af39ee0 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 13 May 2014 18:43:40 -0400 Subject: [PATCH] github_merge: do not crash if PR is not tested (no status) Signed-off-by: Jean Privat --- contrib/github_merge.nit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/github_merge.nit b/contrib/github_merge.nit index 2d8b039..3a056ad 100644 --- a/contrib/github_merge.nit +++ b/contrib/github_merge.nit @@ -36,7 +36,12 @@ redef class GithubCurl prm["statuses"] = statuses print "{prm["title"]}: by {prm["user"].json_as_map["login"]} (# {prm["number"]})" print "\tmergable: {prm["mergeable"]}" - print "\tstatus: {prm["statuses"].json_as_a[0].json_as_map["state"]}" + var st = prm["statuses"].json_as_a + if not st.is_empty then + print "\tstatus: {st[0].json_as_map["state"]}" + else + print "\tstatus: not tested" + end return prm end -- 1.7.9.5