diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-16 21:24:53 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-16 21:24:53 +0200 |
commit | cdef53df1ed3f37cb77a69df4530bc766f2f1617 (patch) | |
tree | c55e2705e26eab60501e3d3499f6676975f5c5de /editor/localization_editor.cpp | |
parent | 691eecd9b61994f0086a9aedfc5e5f058304aadf (diff) | |
parent | 75ee58fd0476360c67375cf403f06644a0aa117e (diff) | |
download | redot-engine-cdef53df1ed3f37cb77a69df4530bc766f2f1617.tar.gz |
Merge pull request #81705 from AThousandShips/null_check_editor
[Editor] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'editor/localization_editor.cpp')
-rw-r--r-- | editor/localization_editor.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index d4154d371b..fb34740318 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -101,7 +101,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p } TreeItem *ti = Object::cast_to<TreeItem>(p_item); - ERR_FAIL_COND(!ti); + ERR_FAIL_NULL(ti); int idx = ti->get_metadata(0); @@ -163,7 +163,7 @@ void LocalizationEditor::_translation_res_option_add(const PackedStringArray &p_ Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); - ERR_FAIL_COND(!k); + ERR_FAIL_NULL(k); String key = k->get_metadata(0); @@ -194,7 +194,7 @@ void LocalizationEditor::_translation_res_select() { void LocalizationEditor::_translation_res_option_popup(bool p_arrow_clicked) { TreeItem *ed = translation_remap_options->get_edited(); - ERR_FAIL_COND(!ed); + ERR_FAIL_NULL(ed); locale_select->set_locale(ed->get_tooltip_text(1)); locale_select->popup_locale_dialog(); @@ -202,7 +202,7 @@ void LocalizationEditor::_translation_res_option_popup(bool p_arrow_clicked) { void LocalizationEditor::_translation_res_option_selected(const String &p_locale) { TreeItem *ed = translation_remap_options->get_edited(); - ERR_FAIL_COND(!ed); + ERR_FAIL_NULL(ed); ed->set_text(1, TranslationServer::get_singleton()->get_locale_name(p_locale)); ed->set_tooltip_text(1, p_locale); @@ -222,9 +222,9 @@ void LocalizationEditor::_translation_res_option_changed() { Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); - ERR_FAIL_COND(!k); + ERR_FAIL_NULL(k); TreeItem *ed = translation_remap_options->get_edited(); - ERR_FAIL_COND(!ed); + ERR_FAIL_NULL(ed); String key = k->get_metadata(0); int idx = ed->get_metadata(0); @@ -299,9 +299,9 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); - ERR_FAIL_COND(!k); + ERR_FAIL_NULL(k); TreeItem *ed = Object::cast_to<TreeItem>(p_item); - ERR_FAIL_COND(!ed); + ERR_FAIL_NULL(ed); String key = k->get_metadata(0); int idx = ed->get_metadata(0); @@ -348,7 +348,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button, } TreeItem *ti = Object::cast_to<TreeItem>(p_item); - ERR_FAIL_COND(!ti); + ERR_FAIL_NULL(ti); int idx = ti->get_metadata(0); |