Skip to content

Commit

Permalink
Fix exception thrown when trying to find a deleted corresponding
Browse files Browse the repository at this point in the history
notebook. Bump to version 1.25.9.
  • Loading branch information
install committed Jun 19, 2015
1 parent ea43d8c commit dfd88d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions evernote-sdk-js/evernote/node/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ var Client = function(options) {
this.consumerKey = options.consumerKey;
this.consumerSecret = options.consumerSecret;
this.sandbox = typeof(options.sandbox) !== 'undefined' ? options.sandbox : true;
var defaultServiceHost;
if (this.sandbox) {
var defaultServiceHost = 'sandbox.evernote.com';
defaultServiceHost = 'sandbox.evernote.com';
} else {
var defaultServiceHost = 'www.evernote.com';
defaultServiceHost = 'www.evernote.com';
}
this.serviceHost = options.serviceHost || defaultServiceHost;
this.additionalHeaders = options.additionalHeaders || {};
Expand All @@ -40,7 +41,7 @@ Client.prototype.getRequestToken = function(callbackUrl, callback) {
var self = this;
var oauth = self.getOAuthClient(callbackUrl);
oauth.getOAuthRequestToken(function(err, oauthToken, oauthTokenSecret, results) {
callback(err, oauthToken, oauthTokenSecret, results)
callback(err, oauthToken, oauthTokenSecret, results);
});
};

Expand Down Expand Up @@ -94,8 +95,11 @@ Client.prototype.getSharedNoteStore = function(linkedNotebook) {
cb(null, self.token, linkedNotebook.noteStoreUrl);
});
noteStore.authenticateToSharedNotebook(linkedNotebook.shareKey, function(err, sharedAuth) {
if (err) {
return callback(err);
}
thisStore.sharedToken = sharedAuth.authenticationToken;
callback(err, thisStore.sharedToken, linkedNotebook.noteStoreUrl);
callback(null, thisStore.sharedToken, linkedNotebook.noteStoreUrl);
});
}
});
Expand Down Expand Up @@ -136,7 +140,7 @@ Client.prototype.getEndpoint = function(path) {
if (path) {
url += '/' + path;
}
return url
return url;
};

var Store = function(clientClass, enInfoFunc) {
Expand Down Expand Up @@ -166,7 +170,7 @@ Store.prototype.createWrapperFunction = function(name) {
}
var orgFunc = client[name];
var orgArgNames = self.getParamNames(orgFunc);
if (orgArgNames != null && orgArgs.length + 1 == orgArgNames.length) {
if (orgArgNames !== null && orgArgs.length + 1 == orgArgNames.length) {
try {
var newArgs = [];
for (var i in orgArgNames) {
Expand All @@ -187,6 +191,9 @@ Store.prototype.createWrapperFunction = function(name) {
Store.prototype.getThriftClient = function(callback) {
var self = this;
self.enInfoFunc(function(err, token, url) {
if (err) {
return callback(err);
}
var m = token.match(/:A=([^:]+):/);
if (m) {
self.userAgentId = m[1];
Expand All @@ -198,7 +205,7 @@ Store.prototype.getThriftClient = function(callback) {
{'User-Agent':
self.userAgentId + ' / ' + pjson.version + '; Node.js / ' + process.version});
var protocol = new Evernote.Thrift.BinaryProtocol(transport);
callback(err, new self.clientClass(protocol), token);
callback(null, new self.clientClass(protocol), token);
});
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Evernote",
"name": "evernote",
"description": "Evernote SDK for Node.js",
"version": "1.25.8-beta",
"version": "1.25.8",
"repository": {
"url": "https://github.com/evernote/evernote-sdk-js"
},
Expand Down

0 comments on commit dfd88d6

Please sign in to comment.