浏览代码

Fixed error: set_current_tab print on project open

Paulb23 9 年之前
父节点
当前提交
a3481ed1c7
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      scene/gui/tab_container.cpp

+ 3 - 2
scene/gui/tab_container.cpp

@@ -412,8 +412,9 @@ void TabContainer::_notification(int p_what) {
 
 		} break;
 		case NOTIFICATION_THEME_CHANGED: {
-
-			call_deferred("set_current_tab",get_current_tab()); //wait until all changed theme
+			if (get_tab_count() > 0) {
+				call_deferred("set_current_tab",get_current_tab()); //wait until all changed theme
+			}
 		} break;
 	}
 }