Skip to content

Commit 14544ef

Browse files
Update ShaderGenerator.js
1 parent c395dee commit 14544ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/webgl/ShaderGenerator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { ancestor } from 'acorn-walk';
99
import escodegen from 'escodegen';
1010

1111
function shadergenerator(p5, fn) {
12+
if (!fn || typeof fn !== 'object') {
13+
throw new Error("fn is not defined or is not an object. Ensure it is passed correctly to shadergenerator.");
14+
1215
let GLOBAL_SHADER;
1316
let BRANCH;
1417

0 commit comments

Comments
 (0)