diff --git a/src/ui/map.js b/src/ui/map.js index 9571fb28b99..af90c38d415 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -339,6 +339,9 @@ class Map extends Camera { this._setupContainer(); this._setupPainter(); + if (this.painter === undefined) { + throw new Error(`Failed to initialize WebGL.`); + } this.on('move', this._update.bind(this, false)); this.on('zoom', this._update.bind(this, true));