Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: remoting/webapp/client_screen.js

Issue 10207028: Fixed callWithToken error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/webapp/host_controller.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_screen.js
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js
index 8be30fbefb50c173907353ca237ba07a8ccb2c3c..2f066e7fc29913f60948c465eb0b51b0473d9f59 100644
--- a/remoting/webapp/client_screen.js
+++ b/remoting/webapp/client_screen.js
@@ -314,11 +314,15 @@ function startSession_() {
/** @type {string} */ (remoting.oauth2.getCachedEmail()),
remoting.ClientSession.Mode.IT2ME,
onClientStateChange_);
- /** @param {string} token The auth token. */
+ /** @param {string?} token The auth token. */
var createPluginAndConnect = function(token) {
- remoting.clientSession.createPluginAndConnect(
- document.getElementById('session-mode'),
- token);
+ if (token) {
+ remoting.clientSession.createPluginAndConnect(
+ document.getElementById('session-mode'),
+ token);
+ } else {
+ showConnectError_(remoting.Error.AUTHENTICATION_FAILED);
+ }
};
remoting.oauth2.callWithToken(createPluginAndConnect);
}
« no previous file with comments | « no previous file | remoting/webapp/host_controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698