diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/SmbConnectDialog.java b/app/src/main/java/com/amaze/filemanager/ui/dialogs/SmbConnectDialog.java index cece107587..ab73e4c7b4 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/SmbConnectDialog.java +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/SmbConnectDialog.java @@ -265,15 +265,18 @@ public void afterTextChanged(@NonNull Editable s) { int domainDelim = !inf.contains(";") ? 0 : inf.indexOf(';'); domainp = inf.substring(0, domainDelim); if (domainp != null && domainp.length() > 0) inf = inf.substring(domainDelim + 1); - userp = inf.substring(0, inf.indexOf(":")); - try { - passp = - PasswordUtil.INSTANCE.decryptPassword( - context, inf.substring(inf.indexOf(COLON) + 1), URL_SAFE); - passp = decode(passp, Charsets.UTF_8.name()); - } catch (GeneralSecurityException | IOException e) { - LOG.warn("Error decrypting password", e); - passp = ""; + if (!inf.contains(":")) userp = inf; + else { + userp = inf.substring(0, inf.indexOf(COLON)); + try { + passp = + PasswordUtil.INSTANCE.decryptPassword( + context, inf.substring(inf.indexOf(COLON) + 1), URL_SAFE); + passp = decode(passp, Charsets.UTF_8.name()); + } catch (GeneralSecurityException | IOException e) { + LOG.warn("Error decrypting password", e); + passp = ""; + } } domain.setText(domainp); user.setText(userp);