handle invalid channels
This commit is contained in:
parent
18e2e66b06
commit
9e749b7cd8
7
rpc.js
7
rpc.js
@ -223,7 +223,6 @@ var getFileSize = function (store, channel, cb) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getMultipleFileSize = function (store, channels, cb) {
|
var getMultipleFileSize = function (store, channels, cb) {
|
||||||
if (!isValidChannel(channel)) { }
|
|
||||||
|
|
||||||
if (!Array.isArray(channels)) { return cb('INVALID_LIST'); }
|
if (!Array.isArray(channels)) { return cb('INVALID_LIST'); }
|
||||||
if (typeof(store.getChannelSize) !== 'function') {
|
if (typeof(store.getChannelSize) !== 'function') {
|
||||||
@ -239,6 +238,10 @@ var getMultipleFileSize = function (store, channels, cb) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
channels.forEach(function (channel) {
|
channels.forEach(function (channel) {
|
||||||
|
if (!isValidChannel(channel)) {
|
||||||
|
counts[channel] = -1;
|
||||||
|
return done();
|
||||||
|
}
|
||||||
store.getChannelSize(channel, function (e, size) {
|
store.getChannelSize(channel, function (e, size) {
|
||||||
if (e) {
|
if (e) {
|
||||||
counts[channel] = -1;
|
counts[channel] = -1;
|
||||||
@ -466,8 +469,6 @@ RPC.create = function (config, cb) {
|
|||||||
if (e) { return void Respond(e); }
|
if (e) { return void Respond(e); }
|
||||||
Respond(void 0, dict);
|
Respond(void 0, dict);
|
||||||
});
|
});
|
||||||
return void Respond('NOT_IMPLEMENTED');
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return void Respond('UNSUPPORTED_RPC_CALL', msg);
|
return void Respond('UNSUPPORTED_RPC_CALL', msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user