Skip to content

Commit

Permalink
Merge pull request #51394 from lawnjelly/portals_fix_log_crash
Browse files Browse the repository at this point in the history
Portals - fix crash when logging link room names
  • Loading branch information
akien-mga authored Aug 8, 2021
2 parents 52b3891 + ef894c0 commit 6149304
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/3d/room_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ void RoomManager::_third_pass_rooms(const LocalVector<Portal *> &p_portals) {
int linked_room_id = (portal_links_out) ? portal._linkedroom_ID[1] : portal._linkedroom_ID[0];

// this shouldn't be out of range, but just in case
if (linked_room_id < _rooms.size()) {
if ((linked_room_id >= 0) && (linked_room_id < _rooms.size())) {
Room *linked_room = _rooms[linked_room_id];

String portal_link_room_name = _find_name_before(linked_room, "-room", true);
Expand Down

0 comments on commit 6149304

Please sign in to comment.