diff --git a/src/main/java/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java b/src/main/java/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java index aa02cf940cb5..389fac994b55 100644 --- a/src/main/java/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java +++ b/src/main/java/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java @@ -181,13 +181,11 @@ public void onClick(DialogInterface dialog, int which) { } else { setPassword(share, null); } - } else if (which == AlertDialog.BUTTON_NEGATIVE) { - if (askForPassword) { - if (share == null) { - setPassword(createShare, file, null); - } else { - setPassword(share, null); - } + } else if (which == AlertDialog.BUTTON_NEGATIVE && askForPassword) { + if (share == null) { + setPassword(createShare, file, null); + } else { + setPassword(share, null); } } }