Skip to content

Commit

Permalink
Map constructor should fail if WebGL init fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
uforic authored and jfirebaugh committed Jun 1, 2018
1 parent 6255e9e commit 99f6ea8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 99f6ea8

Please sign in to comment.