Repository: godot
Issue: Visual Script - Godot 4 - Crash on creating node via function name drag/drop
Labels: bug,topic:editor,topic:visualscript,crash

### Godot version

v4.0.dev.calinou [12e0f10c7]

### System information

Ubuntu 20.04.1, Vulkan, AMD APU

### Issue description

I was attempting to figure out how to add a function start node, as one was not created when I added a new function and did not appear at any point.
I tried pulling the `_ready` function name onto the node editor, the result was a crash.
There may be some other bug here where the start node should have been created, but it wasn't - I don't know how this is supposed to be done.

(The first two errors are repeated often.)
```
ERROR: Condition "!variants_enabled[p_variant]" is true. Returning: RID()
   at: version_get_shader (./servers/rendering/renderer_rd/shader_rd.h:142)
ERROR: Condition "p_shader.is_null()" is true.
   at: setup (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:67)
ERROR: Map key not found.
   at: get (./core/templates/hash_map.h:283)
handle_crash: Program crashed with signal 4
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f07f762c210] (??:0)
[2] HashMap<int, VisualScript::NodeData, HashMapHasherDefault, HashMapComparatorDefault<int>, (unsigned char)3, (unsigned char)8>::get(int const&) const (??:?)
[3] HashMap<int, VisualScript::NodeData, HashMapHasherDefault, HashMapComparatorDefault<int>, (unsigned char)3, (unsigned char)8>::operator[](int const&) const (??:?)
[4] VisualScript::get_method_info(StringName const&) const (??:?)
[5] VisualScriptFunctionCall::_update_method_cache() (??:?)
[6] VisualScriptFunctionCall::set_function(StringName const&) (??:?)
[7] void call_with_variant_args_helper<__UnexistingClass, StringName const&, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(StringName const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (??:?)
[8] void call_with_variant_args_dv<__UnexistingClass, StringName const&>(__UnexistingClass*, void (__UnexistingClass::*)(StringName const&), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (??:?)
[9] MethodBindT<StringName const&>::call(Object*, Variant const**, int, Callable::CallError&) (??:?)
[10] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (??:?)
[11] UndoRedo::_process_operation_list(List<UndoRedo::Operation, DefaultAllocator>::Element*) (??:?)
[12] UndoRedo::_redo(bool) (??:?)
[13] UndoRedo::commit_action(bool) (??:?)
[14] VisualScriptEditor::drop_data_fw(Vector2 const&, Variant const&, Control*) (??:?)
[15] void call_with_variant_args_helper<__UnexistingClass, Vector2 const&, Variant const&, Control*, 0ul, 1ul, 2ul>(__UnexistingClass*, void (__UnexistingClass::*)(Vector2 const&, Variant const&, Control*), Variant const**, Callable::CallError&, IndexSequence<0ul, 1ul, 2ul>) (??:?)
[16] void call_with_variant_args_dv<__UnexistingClass, Vector2 const&, Variant const&, Control*>(__UnexistingClass*, void (__UnexistingClass::*)(Vector2 const&, Variant const&, Control*), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (??:?)
[17] MethodBindT<Vector2 const&, Variant const&, Control*>::call(Object*, Variant const**, int, Callable::CallError&) (??:?)
[18] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (??:?)
[19] Object::call(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) (??:?)
[20] Control::drop_data(Vector2 const&, Variant const&) (??:?)
[21] Viewport::_gui_drop(Control*, Vector2, bool) (??:?)
[22] Viewport::_gui_input_event(Ref<InputEvent>) (??:?)
[23] Viewport::input(Ref<InputEvent> const&, bool) (??:?)
[24] Window::_window_input(Ref<InputEvent> const&) (??:?)
[25] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (??:?)
[26] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (??:?)
[27] CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (??:?)
[28] Callable::call(Variant const**, int, Variant&, Callable::CallError&) const (??:?)
[29] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (??:?)
[30] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (??:?)
[31] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (??:?)
[32] Input::parse_input_event(Ref<InputEvent> const&) (??:?)
[33] Input::flush_accumulated_events() (??:?)
[34] DisplayServerX11::process_events() (??:?)
[35] OS_LinuxBSD::run() (??:?)
[36] /media/20kdc/6d58dae8-1885-49fc-a0c2-ad587ec9e7b9/External2/godot-nightly/godot(main+0x162) [0x1fc5a94] (??:?)
[37] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f07f760d0b3] (??:0)
[38] /media/20kdc/6d58dae8-1885-49fc-a0c2-ad587ec9e7b9/External2/godot-nightly/godot(_start+0x29) [0x1fc5889] (??:?)
```

### Steps to reproduce

Open up `example_vs.vs`, then drag the `_ready` function into the main panel.
For me at least, this will cause an immediate crash.

### Minimal reproduction project

[test.zip](https://github.com/godotengine/godot/files/6651310/test.zip)