Skip to content

Commit

Permalink
Add check to internal methods to prevent crash
Browse files Browse the repository at this point in the history
(cherry picked from commit 448295c)
  • Loading branch information
timothyqiu authored and akien-mga committed Jul 27, 2021
1 parent 9fd201c commit eb31a39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) {
PoolVector<int>::Read r = p_data.read();

int offset = (format == FORMAT_2) ? 3 : 2;
ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data.");

clear();
for (int i = 0; i < c; i += offset) {
Expand Down
1 change: 1 addition & 0 deletions scene/3d/proximity_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void ProximityGroup::broadcast(String p_method, Variant p_parameters) {

void ProximityGroup::_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("broadcast", p_method, p_parameters);
Expand Down

0 comments on commit eb31a39

Please sign in to comment.