diff options
| author | Juan Linietsky | 2017-01-08 17:23:04 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-01-08 17:23:04 -0300 |
| commit | 10938e8bb9f72b235bc6609e6b50e6f6d9aee6a5 (patch) | |
| tree | 081f8b002bf6d1ead08380c6b0f5e631fa256229 /tools/editor/create_dialog.cpp | |
| parent | 547a57777b199f451305a6d4b6ad63fb0b2bd3ed (diff) | |
| download | godot-10938e8bb9f72b235bc6609e6b50e6f6d9aee6a5.tar.gz godot-10938e8bb9f72b235bc6609e6b50e6f6d9aee6a5.tar.zst godot-10938e8bb9f72b235bc6609e6b50e6f6d9aee6a5.zip | |
Made Variant::NIL printable as "Null". Please everyone be on the lookout of bugs related to assigning an empty variant to a string, and expecting it to be not empty!
Diffstat (limited to '')
| -rw-r--r-- | tools/editor/create_dialog.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index 313b1ad18..1b1d5f3a4 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -400,8 +400,11 @@ Object *CreateDialog::instance_selected() { if (selected) { - String custom = selected->get_metadata(0); + Variant md = selected->get_metadata(0); + String custom; + if (md.get_type()!=Variant::NIL) + custom=md; if (custom!=String()) { if (EditorNode::get_editor_data().get_custom_types().has(custom)) { |
