nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3e057b
)
lib/github: fix deserialization of empty branch arrays
author
Alexandre Terrasa
<alexandre@moz-code.org>
Mon, 20 Feb 2017 18:49:31 +0000
(13:49 -0500)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Mon, 20 Feb 2017 18:50:17 +0000
(13:50 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/github/api.nit
patch
|
blob
|
history
diff --git
a/lib/github/api.nit
b/lib/github/api.nit
index
c94031e
..
17de935
100644
(file)
--- a/
lib/github/api.nit
+++ b/
lib/github/api.nit
@@
-200,7
+200,9
@@
class GithubAPI
var array = get("/repos/{repo.full_name}/branches")
var res = new Array[Branch]
if not array isa JsonArray then return res
- return deserialize(array.to_json).as(Array[Branch])
+ var deser = deserialize(array.to_json)
+ if deser isa Array[Object] then return res # empty array
+ return deser.as(Array[Branch])
end
# List of issues associated with their ids.