소스 검색

Fixes crash in case no column in tree is expanded and has minimum size

Gilles Roudière 4 년 전
부모
커밋
c5b65236d8
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      scene/gui/tree.cpp

+ 5 - 2
scene/gui/tree.cpp

@@ -3885,8 +3885,11 @@ int Tree::get_column_width(int p_column) const {
 		}
 
 		ERR_FAIL_COND_V(expanding_columns == 0, -1); // shouldn't happen
-
-		return expand_area * get_column_minimum_width(p_column) / expanding_total;
+		if (expanding_total == 0) {
+			return 0;
+		} else {
+			return expand_area * get_column_minimum_width(p_column) / expanding_total;
+		}
 	} else {
 		return get_column_minimum_width(p_column);
 	}