aboutsummaryrefslogtreecommitdiffstats
path: root/lib/providermanager.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/providermanager.js')
-rw-r--r--lib/providermanager.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/providermanager.js b/lib/providermanager.js
index 83e11605b..1a550e5f4 100644
--- a/lib/providermanager.js
+++ b/lib/providermanager.js
@@ -49,15 +49,15 @@ var ProviderManager = function() {
result = JSON.parse(result);
- // dont call the callback if result is an error, empty array or false
- if (result.error || (result.result instanceof Array ? result.result.length === 0 : !result.result)) {
+ // dont call the callback if result is not an array, or empty one
+ if (result.error || !(result.result instanceof Array) || result.result.length === 0) {
return;
}
- data.callback(result);
+ data.callback(result.result);
});
}
- setTimeout(poll, 12000);
+ setTimeout(poll, 1000);
};
poll();
};
@@ -70,7 +70,7 @@ ProviderManager.prototype.send = function(data) {
if (this.provider === undefined) {
console.error('provider is not set');
- return undefined;
+ return null;
}
//TODO: handle error here?