Browse Source

Fix null access disposing a rfx without root3d

clementlandrin 1 year ago
parent
commit
3b64f588d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hrt/prefab/rfx/RendererFX.hx

+ 1 - 1
hrt/prefab/rfx/RendererFX.hx

@@ -48,7 +48,7 @@ class RendererFX extends Prefab implements h3d.impl.RendererFX {
 
 
 	override function dispose() {
 	override function dispose() {
 		if (this.instance != null) {
 		if (this.instance != null) {
-			var scene = this.instance.shared.root3d.getScene();
+			var scene = this.instance.shared.root3d?.getScene();
 
 
 			if(scene != null)
 			if(scene != null)
 				scene.renderer.effects.remove(this.instance);
 				scene.renderer.effects.remove(this.instance);