Repository: godot
Issue: Freeze when using `GraphEdit.set_end`
Labels: bug,topic:gui

### Godot version

4.0.alpha.custom_build. 690fefe43

### System information

Ubuntu 21.10 - Nvidia GTX 970, Gnome shell 40.4 X11

### Issue description

```
func _process(_delta):
	print("BB")
	var temp_variable6302 = GraphEdit.new()
	add_child(temp_variable6302)
	temp_variable6302.set_scroll_ofs(Vector2(33.4919586181641, -NAN))
	temp_variable6302.set_end(Vector2(-NAN, -NAN))
	print("AA")
```
freeze in this place
```
#0  Vector2::Vector2 (this=0x116d3dc08) at ./core/math/vector2.h:175
#1  0x0000000006303249 in RendererCanvasRender::Item::CommandPrimitive::CommandPrimitive (this=0x116d3dbd0) at ./servers/rendering/renderer_canvas_render.h:247
#2  0x0000000006305ca3 in RendererCanvasRender::Item::alloc_command<RendererCanvasRender::Item::CommandPrimitive> (this=0xd7e6500)
    at ./servers/rendering/renderer_canvas_render.h:495
#3  0x00000000062f9fb0 in RendererCanvasCull::canvas_item_add_line (this=0xae951d0, p_item=..., p_from=..., p_to=..., p_color=..., p_width=1, p_antialiased=false)
    at servers/rendering/renderer_canvas_cull.cpp:559
#4  0x0000000005eb9c9c in RenderingServerDefault::canvas_item_add_line (this=0xae7d570, p1=..., p2=..., p3=..., p4=..., p5=1, p6=false)
    at servers/rendering/rendering_server_default.h:802
#5  0x0000000004aeb9da in CanvasItem::draw_line (this=0xd7aace0, p_from=..., p_to=..., p_color=..., p_width=1, p_antialiased=false) at scene/main/canvas_item.cpp:469
#6  0x0000000004d261e8 in GraphEdit::_notification (this=0xd7aace0, p_what=30) at scene/gui/graph_edit.cpp:496
#7  0x0000000004d42326 in GraphEdit::_notificationv (this=0xd7aace0, p_notification=30, p_reversed=false) at scene/gui/graph_edit.h:94
#8  0x0000000006abc04b in Object::notification (this=0xd7aace0, p_notification=30, p_reversed=false) at core/object/object.cpp:848
#9  0x0000000004ae9eff in CanvasItem::_update_callback (this=0xd7aace0) at scene/main/canvas_item.cpp:142
#10 0x0000000002708022 in call_with_variant_args_helper<__UnexistingClass>(__UnexistingClass*, void (__UnexistingClass::*)(), Variant const**, Callable::CallError&, IndexSequence<>) (p_instance=0xd7aace0, p_method=(void (__UnexistingClass::*)(__UnexistingClass * const)) 0x4ae9e30 <CanvasItem::_update_callback()>, 
    p_args=0x7fffffffd310, r_error=...) at ./core/variant/binder_common.h:236
#11 0x0000000002707139 in call_with_variant_args_dv<__UnexistingClass> (p_instance=0xd7aace0, 
    p_method=(void (__UnexistingClass::*)(__UnexistingClass * const)) 0x4ae9e30 <CanvasItem::_update_callback()>, p_args=0x0, p_argcount=0, r_error=..., 
    default_values=...) at ./core/variant/binder_common.h:383
#12 0x00000000027045e8 in MethodBindT<>::call(Object*, Variant const**, int, Callable::CallError&) (this=0xca44ee0, p_object=0xd7aace0, p_args=0x0, p_arg_count=0, 
    r_error=...) at ./core/object/method_bind.h:334
#13 0x0000000006abbf3e in Object::callp (this=0xd7aace0, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at core/object/object.cpp:839
#14 0x00000000067dbca7 in Callable::call (this=0x7fffe65b4050, p_arguments=0x0, p_argcount=0, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:62
#15 0x0000000006ab4437 in MessageQueue::_call_function (this=0xa551090, p_callable=..., p_args=0x7fffe65b4068, p_argcount=0, p_show_error=false)
    at core/object/message_queue.cpp:229
#16 0x0000000006ab4798 in MessageQueue::flush (this=0xa551090) at core/object/message_queue.cpp:275
#17 0x0000000004b70c40 in SceneTree::process (this=0xd4eed80, p_time=0.15000000000000002) at scene/main/scene_tree.cpp:453
#18 0x00000000023c938b in Main::iteration () at main/main.cpp:2722
#19 0x000000000237cb72 in OS_LinuxBSD::run (this=0x7fffffffd900) at platform/linuxbsd/os_linuxbsd.cpp:356
#20 0x0000000002378ab2 in main (argc=2, argv=0x7fffffffde38) at platform/linuxbsd/godot_linuxbsd.cpp:68

```

### Steps to reproduce

Above

### Minimal reproduction project

_No response_