2
0
Эх сурвалжийг харах

handle null scene in objects on style error

Nicolas Cannasse 2 жил өмнө
parent
commit
0e8963ac24
1 өөрчлөгдсөн 7 нэмэгдсэн , 0 устгасан
  1. 7 0
      h2d/domkit/Style.hx

+ 7 - 0
h2d/domkit/Style.hx

@@ -96,6 +96,13 @@ class Style extends domkit.CssStyle {
 			if( errorsText == null ) {
 				if( currentObjects.length == 0 ) return;
 				var scene = currentObjects[0].getScene();
+				if( scene == null ) {
+					for( o in currentObjects ) {
+						scene = o.getScene();
+						if( scene != null ) break;
+					}
+					if( scene == null ) return;
+				}
 				var fl = new h2d.Flow();
 				scene.add(fl,100);
 				fl.backgroundTile = h2d.Tile.fromColor(0x400000,0.9);