You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
[Editor] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user