Selaa lähdekoodia

this._newUniforms is null bug fixed

NasimiAsl 5 vuotta sitten
vanhempi
commit
552b000b5a
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      materialsLibrary/src/custom/pbrCustomMaterial.ts

+ 2 - 2
materialsLibrary/src/custom/pbrCustomMaterial.ts

@@ -88,14 +88,14 @@ export class PBRCustomMaterial extends PBRMaterial {
     }
 
     public ReviewUniform(name: string, arr: string[]): string[] {
-        if (name == "uniform") {
+        if (this._newUniforms && name == "uniform") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') == -1) {
                     arr.push(this._newUniforms[ind]);
                 }
             }
         }
-        if (name == "sampler") {
+        if (this._newUniforms && name == "sampler") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') != -1) {
                     arr.push(this._newUniforms[ind]);