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

Unified Diff: chrome/common/extensions/docs/examples/extensions/gmail/background.js

Issue 10957006: Fix another stupid bug in Gmail Checker on Chrome 21 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: hate Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/examples/extensions/gmail/background.js
diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/background.js b/chrome/common/extensions/docs/examples/extensions/gmail/background.js
index 898dbb5351d37987f303be24aa3a705305d59b34..8f26bfed9faab3bc64530d430f7eb307f087408e 100644
--- a/chrome/common/extensions/docs/examples/extensions/gmail/background.js
+++ b/chrome/common/extensions/docs/examples/extensions/gmail/background.js
@@ -289,7 +289,9 @@ function onInit() {
function onAlarm(alarm) {
console.log('Got alarm', alarm);
- if (alarm.name == 'watchdog') {
+ // |alarm| can be undefined because onAlarm also gets called from
+ // window.setTimeout on old chrome versions.
+ if (alarm && alarm.name == 'watchdog') {
onWatchdog();
} else {
startRequest({scheduleRequest:true, showLoadingAnimation:false});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698