From 3fad43acad9862663e9c796dda99c0421d0d7364 Mon Sep 17 00:00:00 2001 From: Anilforextra Date: Sun, 9 Jan 2022 15:17:41 +0545 Subject: [PATCH] Path2D: Check points count before rendering. (cherry picked from commit b770a4d0ace3aea4cca3f8926deef82205418fd0) --- scene/2d/path_2d.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 6d3113fbe02..ec262e95e9d 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -94,6 +94,10 @@ void Path2D::_notification(int p_what) { return; } + if (curve->get_point_count() < 2) { + return; + } + #ifdef TOOLS_ENABLED const float line_width = 2 * EDSCALE; #else