summaryrefslogtreecommitdiff
path: root/modules/navigation
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-19 15:24:34 +0200
committerGitHub <noreply@github.com>2022-05-19 15:24:34 +0200
commitce069fbe9909d72b01b2b0571706773cdad31758 (patch)
treeb6ff71e6534764f22daa3671190a548a72e29a1f /modules/navigation
parentb9bb3de6a1680693f8698926859ee3543422c0f2 (diff)
parent6b51ab66d83b7c85e16189eba280a00ab5ff9536 (diff)
Merge pull request #61128 from smix8/navigation_agent_process_mode_4.x
Diffstat (limited to 'modules/navigation')
-rw-r--r--modules/navigation/godot_navigation_server.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp
index 42aad77979..cc9d05da47 100644
--- a/modules/navigation/godot_navigation_server.cpp
+++ b/modules/navigation/godot_navigation_server.cpp
@@ -256,13 +256,19 @@ Array GodotNavigationServer::map_get_agents(RID p_map) const {
RID GodotNavigationServer::region_get_map(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_COND_V(region == nullptr, RID());
- return region->get_map()->get_self();
+ if (region->get_map()) {
+ return region->get_map()->get_self();
+ }
+ return RID();
}
RID GodotNavigationServer::agent_get_map(RID p_agent) const {
RvoAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_COND_V(agent == nullptr, RID());
- return agent->get_map()->get_self();
+ if (agent->get_map()) {
+ return agent->get_map()->get_self();
+ }
+ return RID();
}
RID GodotNavigationServer::region_create() const {