Skip to content

Commit

Permalink
Fix for runtime error that happens when null is provided as context
Browse files Browse the repository at this point in the history
  • Loading branch information
soadzoor committed Apr 29, 2022
1 parent e3f3758 commit b154c2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3>[name]( [param:Object parameters] )</h3>

[page:WebGLRenderingContext context] - This can be used to attach the renderer to an existing
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].
Default is null.<br />
Default is undefined.<br />

[page:String precision] - Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*.
Defaults to *"highp"* if supported by the device. See the note in "Things to Avoid"
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function WebGLRenderer( parameters = {} ) {

let _alpha;

if ( parameters.context !== undefined ) {
if ( _context !== null ) {

_alpha = _context.getContextAttributes().alpha;

Expand Down

0 comments on commit b154c2d

Please sign in to comment.