mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
ChooseRichDocumentsTemplate: avoid IOOBE if there is no dot in field
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
82d86b978b
commit
b7f7388802
1 changed files with 5 additions and 1 deletions
|
@ -249,7 +249,11 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
|
||||||
if (name.isEmpty() || name.equalsIgnoreCase(DOT + template.getExtension())) {
|
if (name.isEmpty() || name.equalsIgnoreCase(DOT + template.getExtension())) {
|
||||||
binding.filename.setText(String.format("%s.%s", template.getName(), template.getExtension()));
|
binding.filename.setText(String.format("%s.%s", template.getName(), template.getExtension()));
|
||||||
}
|
}
|
||||||
binding.filename.setSelection(binding.filename.getText().toString().lastIndexOf('.'));
|
|
||||||
|
final int dotIndex = binding.filename.getText().toString().lastIndexOf('.');
|
||||||
|
if (dotIndex >= 0) {
|
||||||
|
binding.filename.setSelection(dotIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEnablingCreateButton() {
|
private void checkEnablingCreateButton() {
|
||||||
|
|
Loading…
Reference in a new issue