Skip to content

Commit

Permalink
Add null-checking for gl.VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
finscn committed Jan 31, 2018
1 parent 7c6b671 commit bd2de3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderers/webgl/WebGLState.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ function WebGLState( gl, extensions, utils ) {

var maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS );

var version = parseFloat( /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) )[ 1 ] );
var lineWidthAvailable = parseFloat( version ) >= 1.0;
var version = /^WebGL\ ([0-9])/.exec( gl.getParameter( gl.VERSION ) );
version = version ? parseFloat( version[ 1 ] ) : 1.0;
var lineWidthAvailable = version >= 1.0;

var currentTextureSlot = null;
var currentBoundTextures = {};
Expand Down

0 comments on commit bd2de3e

Please sign in to comment.