Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
for obj in array do
if not obj isa JsonObject then continue
var id = obj["id"].as(Int)
for obj in array do
if not obj isa JsonObject then continue
var id = obj["id"].as(Int)
- res.add(api.load_issue_comment(repo, id).as(not null))
+ var comment = api.load_issue_comment(repo, id)
+ if comment == null then continue
+ res.add(comment)
- array = api.get("{key}/comments?page={page}").as(JsonArray)
+ var json = api.get("{key}/comments?page={page}")
+ if not json isa JsonArray then
+ return res
+ end
+ array = json