From 4b34800f57dd5ddb90e70070e9b1bd74506ff76e Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 3 Feb 2015 22:24:49 +0100 Subject: [PATCH] github/api: return an empty list instead of crashing for issues without labels Signed-off-by: Alexandre Terrasa --- lib/github/api.nit | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/github/api.nit b/lib/github/api.nit index 782d598..ba8943e 100644 --- a/lib/github/api.nit +++ b/lib/github/api.nit @@ -678,6 +678,7 @@ class Issue # List of labels on this issue associated to their names. fun labels: Map[String, Label] do var res = new HashMap[String, Label] + if not json.has_key("labels") then return res for obj in json["labels"].as(JsonArray) do if not obj isa JsonObject then continue var name = obj["name"].to_s -- 1.7.9.5