diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/ChooseTemplateDialogFragment.java b/app/src/main/java/com/owncloud/android/ui/dialog/ChooseTemplateDialogFragment.java index 761984390d..336b869052 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/ChooseTemplateDialogFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/dialog/ChooseTemplateDialogFragment.java @@ -286,11 +286,13 @@ public class ChooseTemplateDialogFragment extends DialogFragment implements View } private void checkEnablingCreateButton() { - Template selectedTemplate = adapter.getSelectedTemplate(); - String name = binding.filename.getText().toString(); + if (positiveButton != null) { + Template selectedTemplate = adapter.getSelectedTemplate(); + String name = binding.filename.getText().toString(); - positiveButton.setEnabled(selectedTemplate != null && !name.isEmpty() && - !name.equalsIgnoreCase(DOT + selectedTemplate.getExtension())); + positiveButton.setEnabled(selectedTemplate != null && !name.isEmpty() && + !name.equalsIgnoreCase(DOT + selectedTemplate.getExtension())); + } } private static class CreateFileFromTemplateTask extends AsyncTask {