Fixed case where plugin upgrade checker crashed

... if no extraneous plugins were installed. Hooray for not
testing the null case!
This commit is contained in:
Julian Lam
2016-03-16 10:45:41 -04:00
parent 92b8d66153
commit 13210a91e6

5
nodebb
View File

@@ -118,8 +118,11 @@ var getRunningPid = function(callback) {
version: async.apply(getCurrentVersion)
}),
function(payload, next) {
var toCheck = Object.keys(payload.plugins);
if (!payload.plugins.length) {
return next(null, []); // no extraneous plugins installed
}
var toCheck = Object.keys(payload.plugins);
request({
method: 'GET',
url: 'https://packages.nodebb.org/api/v1/suggest?version=' + payload.version + '&package[]=' + toCheck.join('&package[]='),