Ver código fonte

TSL: Show an error message if no stack defined for assign operation (#31756)

sunag 4 meses atrás
pai
commit
105a9940bd
1 arquivos alterados com 9 adições e 1 exclusões
  1. 9 1
      src/nodes/tsl/TSLCore.js

+ 9 - 1
src/nodes/tsl/TSLCore.js

@@ -59,7 +59,15 @@ Node.prototype.assign = function ( ...params ) {
 
 
 	if ( this.isStackNode !== true ) {
 	if ( this.isStackNode !== true ) {
 
 
-		currentStack.assign( this, ...params );
+		if ( currentStack !== null ) {
+
+			currentStack.assign( this, ...params );
+
+		} else {
+
+			console.error( 'THREE.TSL: No stack defined for assign operation. Make sure the assign is inside a Fn().' );
+
+		}
 
 
 		return this;
 		return this;
 
 

粤ICP备19079148号