summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-14 17:06:23 +0100
committerGitHub <noreply@github.com>2022-02-14 17:06:23 +0100
commit45428e91baf6298b978c632d313fd7944f26d74f (patch)
tree27f2fe6143cad2ffc076990e18e32199f544a4d3
parentf810f76890f23843f3895262fe2f88a7d5d3c3f3 (diff)
parent66838d88e1b0b26aff727ae9aa966289115b4a31 (diff)
Merge pull request #58095 from timothyqiu/intersect-point
-rw-r--r--servers/physics_server_2d.cpp2
-rw-r--r--servers/physics_server_3d.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp
index d8f2a2a780..45816e3244 100644
--- a/servers/physics_server_2d.cpp
+++ b/servers/physics_server_2d.cpp
@@ -336,6 +336,8 @@ Dictionary PhysicsDirectSpaceState2D::_intersect_ray(const Ref<PhysicsRayQueryPa
}
Array PhysicsDirectSpaceState2D::_intersect_point(const Ref<PhysicsPointQueryParameters2D> &p_point_query, int p_max_results) {
+ ERR_FAIL_COND_V(p_point_query.is_null(), Array());
+
Vector<ShapeResult> ret;
ret.resize(p_max_results);
diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp
index 8fafd07f87..fc119e49e9 100644
--- a/servers/physics_server_3d.cpp
+++ b/servers/physics_server_3d.cpp
@@ -339,6 +339,8 @@ Dictionary PhysicsDirectSpaceState3D::_intersect_ray(const Ref<PhysicsRayQueryPa
}
Array PhysicsDirectSpaceState3D::_intersect_point(const Ref<PhysicsPointQueryParameters3D> &p_point_query, int p_max_results) {
+ ERR_FAIL_COND_V(p_point_query.is_null(), Array());
+
Vector<ShapeResult> ret;
ret.resize(p_max_results);