summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-09 19:13:21 +0100
committerGitHub <noreply@github.com>2022-01-09 19:13:21 +0100
commitb6b81e800a2a1dde5795b7aa45ae7aa2e3e80f5b (patch)
treee06d682f55a53e13947402c02a228813a783835e
parent5a61822d7ccab39b00ddd5c9bcc01fb04112b976 (diff)
parentb770a4d0ace3aea4cca3f8926deef82205418fd0 (diff)
Merge pull request #56643 from AnilBK/path2D-check-point-count
Path2D: Check points count before rendering.
-rw-r--r--scene/2d/path_2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 4f24b0e004..742756113f 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -93,6 +93,10 @@ void Path2D::_notification(int p_what) {
return;
}
+ if (curve->get_point_count() < 2) {
+ return;
+ }
+
#ifdef TOOLS_ENABLED
const real_t line_width = 2 * EDSCALE;
#else