From 6cd4006fb3f20ac756517aa0f70720a870f9617a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 23 Feb 2019 20:07:16 -0300 Subject: Do not crash on empty path, closes #23701 --- scene/2d/path_2d.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scene/2d') 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); -- cgit v1.2.3