Explorar o código

Fixes crash in Spatial::notification

Haoyu Qiu %!s(int64=5) %!d(string=hai) anos
pai
achega
df3fad11fd
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      scene/3d/spatial.cpp

+ 1 - 0
scene/3d/spatial.cpp

@@ -125,6 +125,7 @@ void Spatial::_notification(int p_what) {
 
 	switch (p_what) {
 		case NOTIFICATION_ENTER_TREE: {
+			ERR_FAIL_COND(!get_tree());
 
 			Node *p = get_parent();
 			if (p)