godot: Using `get_polygon()` and attempting to access elements of the array causes crash. `extends Polygon2D`

Godot version

4.0.stable.official.92bee43ad

System information

Mac

Issue description

@tool
extends Polygon2D

func _draw():
	var poly = get_polygon()
	if not len(poly):
		return

	for i in range(1, poly.size() - 1):
		draw_line(poly[i-1], poly[i], outline, width)

Will result in a crash

Steps to reproduce

Please see above

Minimal reproduction project

Please see above

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

@tavurth Please upload a minimal reproduction project to make this easier to troubleshoot.