Skip to content

Commit 3af6e77

Browse files
committed
Fix potential null error
Closes #747
1 parent ee994ce commit 3af6e77

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎src/effects/TextureEffect.js‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,15 @@ export class TextureEffect extends Effect {
163163

164164
get uvTransform() {
165165

166-
const texture = this.texture;
167-
return (texture !== null && texture.matrixAutoUpdate);
166+
return (this.texture !== null && this.texture.matrixAutoUpdate);
168167

169168
}
170169

171170
set uvTransform(value) {
172171

173-
const texture = this.texture;
174-
175-
if(texture !== null) {
172+
if(this.texture !== null) {
176173

177-
texture.matrixAutoUpdate = value;
174+
this.texture.matrixAutoUpdate = value;
178175

179176
}
180177

@@ -215,9 +212,11 @@ export class TextureEffect extends Effect {
215212

216213
update(renderer, inputBuffer, deltaTime) {
217214

218-
if(this.texture.matrixAutoUpdate) {
215+
const texture = this.texture;
216+
217+
if(texture !== null && texture.matrixAutoUpdate) {
219218

220-
this.texture.updateMatrix();
219+
texture.updateMatrix();
221220

222221
}
223222

0 commit comments

Comments
 (0)