Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Empty repo: Cannot read property 'split' of undefined #1048

Open useo6 opened 6 years ago

useo6 commented 6 years ago

I created a new project and strider told me everything is fine, but when I want configure my project (/project/name/config), strider crashes with the following message:

/root/strider/node_modules/strider-git/lib/index.js:132
    return line.split(/\s+/)[1].split('/').slice(-1)[0];
                               ^

TypeError: Cannot read property 'split' of undefined
    at /root/strider/node_modules/strider-git/lib/index.js:132:32
    at Array.map (<anonymous>)
    at processBranches (/root/strider/node_modules/strider-git/lib/index.js:131:39)
    at /root/strider/node_modules/strider-git/lib/index.js:153:7
    at ChildProcess.exithandler (child_process.js:267:7)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
1726 died 1 null
1747 forked
knownasilya commented 6 years ago

Did you get a chance to update your plugins first?

ghost commented 6 years ago

I updated all plugins an the error was solved. Thank you!

useo6 commented 6 years ago

I figured out that not the plugin upgrade solved the issue. I tried to clone an empty git repository for testing purposes. So, when the repository is empty, strider crashes with the error message above. I know, it makes no sense to add an empty repository, but I never thought that this could be a problem.

knownasilya commented 6 years ago

Sounds like a bug. Will keep open.