Strider-CD / strider-gitlab

Seamless integration between Strider and GitLab
25 stars 16 forks source link

Running Test from Configure project page crashes #27

Closed saraf closed 9 years ago

saraf commented 9 years ago

If the project does not contain a strider.json. In webapp.getFile, we are ignoring the error received in our callback and trying to read res.text, without trying to check if res exists.

    /noderoot/strider-gitlab/lib/webapp.js:51
          done(err, res.text);
                       ^
    TypeError: Cannot read property 'text' of null
        at /noderoot/strider-gitlab/lib/webapp.js:51:20
        at /noderoot/strider-gitlab/lib/api.js:45:16
        at Request.callback (/noderoot/strider-gitlab/node_modules/superagent/lib/node/index.js:797:3)
        at Stream.<anonymous> (/noderoot/strider-gitlab/node_modules/superagent/lib/node/index.js:991:12)
        at Stream.emit (events.js:129:20)
        at Unzip.<anonymous> (/noderoot/strider-gitlab/node_modules/superagent/lib/node/utils.js:108:12)
        at Unzip.emit (events.js:129:20)
        at _stream_readable.js:908:16
        at process._tickDomainCallback (node.js:381:11)

Wrote a failing test for this scenario.