Chromium Code Reviews| Index: components/neterror/resources/offline.js |
| diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js |
| index 005f4f3ae20dc570369df092d783a9e5bfec0e13..9b5d9770605d87f4e4fa78753fa9af575881fde6 100644 |
| --- a/components/neterror/resources/offline.js |
| +++ b/components/neterror/resources/offline.js |
| @@ -292,7 +292,13 @@ Runner.prototype = { |
| this.spriteDef = Runner.spriteDefinition.LDPI; |
| } |
| - this.init(); |
| + if (Runner.imageSprite.complete) { |
| + this.init(); |
| + } else { |
| + // If the images are not yet loaded, add a listener. |
| + Runner.imageSprite.addEventListener(Runner.events.LOAD, |
| + this.init.bind(this)); |
|
edwardjung
2016/07/20 21:39:17
Nit: JS style is to indent by four spaces and not
kkhorimoto
2016/07/21 18:30:23
Done.
|
| + } |
| }, |
| /** |
| @@ -660,7 +666,9 @@ Runner.prototype = { |
| if (!this.activated) { |
| this.loadSounds(); |
| this.activated = true; |
| - errorPageController.trackEasterEgg(); |
| + if (window.errorPageController) { |
| + errorPageController.trackEasterEgg(); |
| + } |
| } |
| if (!this.tRex.jumping && !this.tRex.ducking) { |