Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Jul 24, 2016
1 parent fedd29d commit 232e9b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/phabricator.coffee
Expand Up @@ -127,7 +127,8 @@ class Phabricator
data = @data
query = { 'names[0]': project }
@phabGet msg, query, 'project.query', (json_body) ->
if Object.keys(json_body.result.data).length > 0
if (typeof json_body.result.data is 'array') or
Object.keys(json_body.result.data).length > 0
phid = Object.keys(json_body.result.data)[0]
data.projects[project] = { phid: phid }
projectData = {
Expand Down

0 comments on commit 232e9b3

Please sign in to comment.