Storage object null when adding twitter credentials as first ever node

This commit is contained in:
Nicholas O'Leary 2013-11-22 13:53:34 +00:00
parent 1967046cc8
commit 3054b04378
1 changed files with 4 additions and 0 deletions

View File

@ -207,6 +207,10 @@ var credentials = {};
module.exports.addCredentials = function(id,creds) {
credentials[id] = creds;
if (!storage) {
// Do this lazily to ensure the storage provider as been initialised
storage = require("./storage");
}
storage.saveCredentials(credentials);
}
module.exports.getCredentials = function(id) {