diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index cd96e3d1..d878f0a8 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -609,10 +609,9 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { AutofillPreferences.directoryStructure(applicationContext) val entry = PasswordEntry(content) returnIntent.putExtra("PASSWORD", entry.password) - returnIntent.putExtra( - "USERNAME", - directoryStructure.getUsernameFor(file) - ) + val username = PasswordEntry(content).username + ?: directoryStructure.getUsernameFor(file) + returnIntent.putExtra("USERNAME", username) } setResult(RESULT_OK, returnIntent)