mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Fix NPE in ChooseTemplateDialogFragment.checkEnablingCreateButton
This method can be called before positiveButton is initialized Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
82daff8797
commit
3ce883466b
1 changed files with 6 additions and 4 deletions
|
@ -286,11 +286,13 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEnablingCreateButton() {
|
private void checkEnablingCreateButton() {
|
||||||
Template selectedTemplate = adapter.getSelectedTemplate();
|
if (positiveButton != null) {
|
||||||
String name = binding.filename.getText().toString();
|
Template selectedTemplate = adapter.getSelectedTemplate();
|
||||||
|
String name = binding.filename.getText().toString();
|
||||||
|
|
||||||
positiveButton.setEnabled(selectedTemplate != null && !name.isEmpty() &&
|
positiveButton.setEnabled(selectedTemplate != null && !name.isEmpty() &&
|
||||||
!name.equalsIgnoreCase(DOT + selectedTemplate.getExtension()));
|
!name.equalsIgnoreCase(DOT + selectedTemplate.getExtension()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class CreateFileFromTemplateTask extends AsyncTask<Void, Void, String> {
|
private static class CreateFileFromTemplateTask extends AsyncTask<Void, Void, String> {
|
||||||
|
|
Loading…
Reference in a new issue