Browse Source

[hide] Fix error message on close all

Clément Espeute 5 tháng trước cách đây
mục cha
commit
9e2d1dc8bf
3 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 4 0
      hide/ui/View.hx
  2. 4 1
      hide/view/FXEditor.hx
  3. 3 0
      hide/view/shadereditor/ShaderEditor.hx

+ 4 - 0
hide/ui/View.hx

@@ -228,6 +228,10 @@ class View<T> extends hide.comp.Component {
 			}
 		undo.clear();
 		syncTitle();
+
+		// can happen on close all
+		if (element == null)
+			return;
 		element.empty();
 		element.off();
 		onDisplay();

+ 4 - 1
hide/view/FXEditor.hx

@@ -1837,7 +1837,10 @@ class FXEditor extends hide.view.FileView {
 	}
 
 	public function setRenderPropsEditionVisibility(visible : Bool) {
-		var renderPropsEditionEl = this.element.find('.render-props-edition');
+		var renderPropsEditionEl = this.element?.find('.render-props-edition');
+		// can appen on close
+		if (renderPropsEditionEl == null)
+			return;
 
 		if (!visible) {
 			renderPropsEditionEl.css({ display : 'none' });

+ 3 - 0
hide/view/shadereditor/ShaderEditor.hx

@@ -187,6 +187,9 @@ class ShaderEditor extends hide.view.FileView implements GraphInterface.IGraphEd
 	}
 
 	function reloadView() {
+		// can happen on close
+		if (element == null)
+			return;
 
 		element.html("");
 		loadSettings();