Add check to internal methods to prevent crash

This commit is contained in:
Haoyu Qiu 2021-07-27 12:26:13 +08:00
parent e6a544c169
commit 448295cd51
2 changed files with 2 additions and 0 deletions

View File

@ -795,6 +795,7 @@ void TileMap::_set_tile_data(const Vector<int> &p_data) {
const int *r = p_data.ptr();
int offset = (format >= FORMAT_2) ? 3 : 2;
ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data.");
clear();

View File

@ -128,6 +128,7 @@ void ProximityGroup3D::broadcast(String p_method, Variant p_parameters) {
void ProximityGroup3D::_proximity_group_broadcast(String p_method, Variant p_parameters) {
if (dispatch_mode == MODE_PROXY) {
ERR_FAIL_COND(!is_inside_tree());
get_parent()->call(p_method, p_parameters);
} else {
emit_signal(SNAME("broadcast"), p_method, p_parameters);