From 013de4a3667110040b868f72459627f0f6baf1cb Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 18 Jun 2019 22:39:58 -0400 Subject: [PATCH 1/1] github: Fix `GithubAPI::load_repo_branches` Signed-off-by: Alexandre Terrasa --- lib/github/api.nit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/github/api.nit b/lib/github/api.nit index 4eb9a97..1cb3249 100644 --- a/lib/github/api.nit +++ b/lib/github/api.nit @@ -201,8 +201,12 @@ class GithubAPI var res = new Array[Branch] if not array isa JsonArray then return res var deser = deserialize(array.to_json) - if deser isa Array[Object] then return res # empty array - return deser.as(Array[Branch]) + if not deser isa Array[Object] then return res # empty array + for branch in deser do + if not branch isa Branch then continue + res.add branch + end + return res end # List of issues associated with their ids. -- 1.7.9.5