summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-02-23 20:07:16 -0300
committerJuan Linietsky <juan@godotengine.org>2019-02-23 20:07:16 -0300
commit6cd4006fb3f20ac756517aa0f70720a870f9617a (patch)
tree529df231362c4d808d5c6f0ef27bc9241c3c522a /scene/2d
parentd79c8d76551990dd45594d01635ae7b0a2d9f90e (diff)
Do not crash on empty path, closes #23701
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/path_2d.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 271e132002..fec861ad2f 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -170,6 +170,9 @@ void PathFollow2D::_update_transform() {
return;
float path_length = c->get_baked_length();
+ if (path_length == 0) {
+ return;
+ }
float bounded_offset = offset;
if (loop)
bounded_offset = Math::fposmod(bounded_offset, path_length);