Repository: godot
Issue: Crash when using PROPERTY_HINT_TYPE_STRING with an empty or incorrect hint_string
Labels: bug,topic:editor,crash

### Godot version

4.1.3, 4.2-rc1 and https://github.com/godotengine/godot/commit/923ef2b46a04e8f54c0a60bae8a0a6269fa52ed2

### System information

Linux (tested Arch and Ubuntu 22.04)

### Issue description

I'm trying to use `PROPERTY_HINT_TYPE_STRING`:

```gdscript
@tool
extends Node3D

var my_field: String = "Object"

func _get_property_list():
    var properties = []
    properties.append({
        "name": "my_field",
        "type": TYPE_STRING,
        "usage": PROPERTY_USAGE_DEFAULT,
        "hint": PROPERTY_HINT_TYPE_STRING
    })
    return properties
```

When I click this property in the inspector, Godot crashes:

```
ERROR: Class name cannot be empty.
   at: get_class_icon (editor/editor_node.cpp:4308)
ERROR: FATAL: Condition "!exists" is true.
   at: operator[] (./core/templates/hash_map.h:504)
```

Backtrace for 4.1.3 (copied from gdb because it contains more information):

```
Thread 1 "godot" received signal SIGILL, Illegal instruction.
#0  0x000055555825c3b4 in HashMap<String, Vector<EditorData::CustomType>, HashMapHasherDefault, HashMapComparatorDefault<String>, DefaultTypedAllocator<HashMapElement<String, Vector<EditorData::CustomType> > > >::operator[] (
    this=0x55556191d568, p_key=...)
        at ./core/templates/hash_map.h:501
#1  HashMap<String, Vector<EditorData::CustomType>, HashMapHasherDefault, HashMapComparatorDefault<String>, DefaultTypedAllocator<HashMapElement<String, Vector<EditorData::CustomType> > > >::operator[] (p_key=..., 
    this=0x55556191d568)
        at ./core/templates/hash_map.h:501
#2  CreateDialog::_configure_search_option_item (this=this@entry=0x555579342d70, r_item=r_item@entry=0x555562044140, p_type=..., p_type_category=<optimized out>)
        at editor/create_dialog.cpp:328
#3  0x000055555825e359 in CreateDialog::_update_search (this=this@entry=0x555579342d70)
        at editor/create_dialog.cpp:175
#4  0x000055555825f0e6 in CreateDialog::popup_create (this=this@entry=0x555579342d70, p_dont_clear=p_dont_clear@entry=true, p_replace_mode=p_replace_mode@entry=true, p_current_type=..., p_current_name=...)
    at editor/create_dialog.cpp:57
#5  0x00005555575ce3dc in EditorPropertyClassName::_property_selected (this=<optimized out>)
        at editor/editor_properties.cpp:624
#6  0x000055555a9b425b in Object::emit_signalp (this=<optimized out>, p_name=..., p_args=0x0, p_argcount=0)
        at core/object/object.cpp:1070
#7  0x0000555558846704 in Object::emit_signal<>(StringName const&) (p_name=..., this=0x5555791d8940)
        at ./core/object/object.h:884
#8  BaseButton::_pressed (this=this@entry=0x5555791d8940)
        at scene/gui/base_button.cpp:138
#9  0x000055555884798d in BaseButton::on_action_event (this=this@entry=0x5555791d8940, p_event=...)
        at scene/gui/base_button.cpp:172
#10 0x0000555558847d8b in BaseButton::gui_input (this=0x5555791d8940, p_event=...)
        at scene/gui/base_button.cpp:69
#11 0x00005555587bd856 in Viewport::_gui_call_input (this=this@entry=0x5555618b0c70, p_control=p_control@entry=0x5555791d8940, p_input=...)
        at scene/main/viewport.cpp:1555
#12 0x00005555587c2ec0 in Viewport::_gui_input_event (this=this@entry=0x5555618b0c70, p_event=...)
        at scene/main/viewport.cpp:1826
#13 0x00005555587ddc01 in Viewport::push_input (this=0x5555618b0c70, p_event=..., p_local_coords=<optimized out>)
        at scene/main/viewport.cpp:2993
#14 0x000055555882d02a in call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul> (r_error=..., p_args=<optimized out>, p_method=<optimized out>, p_instance=<optimized out>)
        at ./core/variant/binder_common.h:303
#15 call_with_variant_args<Window, Ref<InputEvent> const&> (r_error=..., p_argcount=<optimized out>, p_args=<optimized out>, p_method=<optimized out>, p_instance=<optimized out>)
        at ./core/variant/binder_common.h:417
#16 CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call (this=<optimized out>, p_arguments=<optimized out>, p_argcount=<optimized out>, r_return_value=..., r_call_error=...)
    at ./core/object/callable_method_pointer.h:104
#17 0x000055555640d76a in DisplayServerX11::_dispatch_input_event (this=0x55555ddf0470, p_event=...)
        at platform/linuxbsd/x11/display_server_x11.cpp:3724
#18 0x000055555a645268 in Input::_parse_input_event_impl (this=this@entry=0x55555d6be7f0, p_event=..., p_is_emulated=p_is_emulated@entry=false)
        at core/input/input.cpp:720
#19 0x000055555a648321 in Input::flush_buffered_events (this=0x55555d6be7f0)
        at core/input/input.cpp:978
#20 0x000055555640ee6e in DisplayServerX11::process_events (this=0x55555ddf0470)
        at platform/linuxbsd/x11/display_server_x11.cpp:4792
#21 0x00005555563e532d in OS_LinuxBSD::run (this=this@entry=0x7fffffffda20)
        at platform/linuxbsd/os_linuxbsd.cpp:908
#22 0x00005555563d4c98 in main (argc=<optimized out>, argv=0x7fffffffdff8)
        at platform/linuxbsd/godot_linuxbsd.cpp:74
```

### Steps to reproduce

Attach this script to any node and click "My Field" in the inspector.

### Minimal reproduction project

N/A