dpa99c / cordova-check-plugins

A CLI tool to check for / manage plugin updates in Cordova/Phonegap projects.
217 stars 25 forks source link

Fix for case when npm view pkg version returns multiple empty lines #6

Closed simonwaterer closed 8 years ago

simonwaterer commented 8 years ago

Fixes the following crash:

TypeError: Cannot read property '1' of null
    at ...\npm\node_modules\cordova-check-plugins\index.js:115:56
    at ChildProcess.exithandler (child_process.js:742:7)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

I found that it was caused by npm view pkg version returning 2 empty lines in its output instead of the 1 that is assumed in the code. Fixed the code to handle multiple empty lines.

I am using npm 2.9.1 and nodejs 0.12.3 on Windows 10.

dpa99c commented 8 years ago

Thanks. I'll bump the version number and push this out to npm.