Skip to content

Commit

Permalink
add error checking to include parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Feb 24, 2016
1 parent 8350e0e commit 807a8ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ THREE.WebGLProgram = ( function () {
var pattern = /#include[ \t]+<([\w\d.]+)>/g;

function replace( match, include ) {
return parseIncludes( THREE.ShaderChunk[ include ] );
var replace = THREE.ShaderChunk[ include ];
if( ! replace ) throw new Error( "can not resolve #include <"+include+">");
return parseIncludes( replace );

}

Expand Down

0 comments on commit 807a8ec

Please sign in to comment.