Skip to content

Commit 8a8268a

Browse files
Correct parse JSON responses
1 parent 337c287 commit 8a8268a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/webapp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ module.exports = {
3030
api.get(config, 'projects', function (err, repos) {
3131
if (err) return done(err);
3232

33+
repos = JSON.parse(repos);
34+
3335
// Parse and filter only git repos
3436
done(null, repos.map(api.parseRepo).filter(function (repo) {
3537
return repo.config.scm === 'git';
@@ -54,6 +56,9 @@ module.exports = {
5456
var uri = util.format('projects/%d/repository/branches', repo_id);
5557

5658
api.get(account, uri, function (err, branches) {
59+
60+
branches = JSON.parse(branches);
61+
5762
done(err, _.map(branches || [], function (branch) {
5863
return branch.name
5964
}));

0 commit comments

Comments
 (0)