Merge pull request #31970 from HaSa1002/i18n

Fixed out of range crash on remapping files for translation
This commit is contained in:
Rémi Verschelde 2019-09-24 10:07:20 +02:00 committed by GitHub
commit fd3c825034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1309,7 +1309,7 @@ void ProjectSettingsEditor::_translation_res_option_changed() {
ERR_FAIL_COND(!remaps.has(key)); ERR_FAIL_COND(!remaps.has(key));
PoolStringArray r = remaps[key]; PoolStringArray r = remaps[key];
ERR_FAIL_INDEX(idx, r.size()); ERR_FAIL_INDEX(idx, r.size());
if (translation_locales_idxs_remap.size() > 0) { if (translation_locales_idxs_remap.size() > which) {
r.set(idx, path + ":" + langs[translation_locales_idxs_remap[which]]); r.set(idx, path + ":" + langs[translation_locales_idxs_remap[which]]);
} else { } else {
r.set(idx, path + ":" + langs[which]); r.set(idx, path + ":" + langs[which]);