Repository: godot
Issue: Executing `GraphEdit.connect_node` after `replace_by` crashes Godot
Labels: bug,topic:core,crash

### Godot version

3.4.beta.custom_build. 01ae4888e

### System information

Ubuntu 21.04 - Nvidia GTX 970, Gnome shell 3.38 X11

### Issue description

When executing
```
func _process(delta) -> void:
	var temp_variable168 = GraphEdit.new()
	add_child(temp_variable168)
	var temp_argument168_f87_0 = ProgressBar.new()
	temp_variable168.replace_by(temp_argument168_f87_0, false)
	temp_argument168_f87_0.queue_free()
	temp_variable168.connect_node("489804426", 13, "2585820213", -12)
```

Godot crashes with this backtrace
```
scene/gui/graph_edit.cpp:208:19: runtime error: member access within null pointer of type 'struct GraphEditFilter'
scene/gui/graph_edit.cpp:208:19: runtime error: member call on null pointer of type 'struct CanvasItem'
scene/gui/graph_edit.cpp:208:19: runtime error: member access within null pointer of type 'struct CanvasItem'

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v3.4.beta.custom_build (512211b61c82ec693b5b198a6238a94cdfdf953c)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] godots() [0x17da12a] (/mnt/Miecz/godot3.2/platform/x11/crash_handler_x11.cpp:56)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7ff07fe59040] (??:0)
[3] GraphEdit::connect_node(StringName const&, int, StringName const&, int) (/mnt/Miecz/godot3.2/scene/gui/graph_edit.cpp:208)
[4] MethodBind4R<Error, StringName const&, int, StringName const&, int>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/./core/method_bind.gen.inc:3325 (discriminator 20))
[5] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/core/object.cpp:918 (discriminator 1))
[6] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/mnt/Miecz/godot3.2/core/variant_call.cpp:1175 (discriminator 1))
[7] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript_function.cpp:1049)
[8] GDScriptInstance::call_multilevel(StringName const&, Variant const**, int) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript.cpp:1184)
[9] Node::_notification(int) (/mnt/Miecz/godot3.2/scene/main/node.cpp:54)
[10] Node::_notificationv(int, bool) (/mnt/Miecz/godot3.2/./scene/main/node.h:45 (discriminator 14))
[11] CanvasItem::_notificationv(int, bool) (/mnt/Miecz/godot3.2/./scene/2d/canvas_item.h:163 (discriminator 3))
[12] Node2D::_notificationv(int, bool) (/mnt/Miecz/godot3.2/./scene/2d/node_2d.h:37 (discriminator 3))
[13] Object::notification(int, bool) (/mnt/Miecz/godot3.2/core/object.cpp:929)
[14] SceneTree::_notify_group_pause(StringName const&, int) (/mnt/Miecz/godot3.2/scene/main/scene_tree.cpp:977)
[15] SceneTree::idle(float) (/mnt/Miecz/godot3.2/scene/main/scene_tree.cpp:528 (discriminator 3))
[16] Main::iteration() (/mnt/Miecz/godot3.2/main/main.cpp:2186)
[17] OS_X11::run() (/mnt/Miecz/godot3.2/platform/x11/os_x11.cpp:3641)
[18] godots(main+0x326) [0x17d0dac] (/mnt/Miecz/godot3.2/platform/x11/godot_x11.cpp:57)
[19] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xd5) [0x7ff07fe40565] (??:0)
[20] godots(_start+0x2e) [0x17d09ce] (??:?)
-- END OF BACKTRACE --
================================================================


```


This example was found by fuzzer, so it is very unlikelly that such code could be spotted in real project, but still even with broken code, Godot should not crash.

### Steps to reproduce

Above

### Minimal reproduction project

_No response_