Keep the first line as the password even if it is empty
This commit is contained in:
parent
3ffbf68ab8
commit
867a59b513
1 changed files with 3 additions and 3 deletions
|
|
@ -87,15 +87,15 @@ public class Password {
|
|||
additions.removeAll()
|
||||
|
||||
// split the plain text
|
||||
let plainTextSplit = self.plainText.split(omittingEmptySubsequences: true) {
|
||||
let plainTextSplit = self.plainText.split(omittingEmptySubsequences: false) {
|
||||
$0 == "\n" || $0 == "\r\n"
|
||||
}.map(String.init)
|
||||
|
||||
// get password
|
||||
password = plainTextSplit.first ?? ""
|
||||
|
||||
// get remaining lines
|
||||
let additionalLines = plainTextSplit[1...]
|
||||
// get remaining lines (filter out empty lines)
|
||||
let additionalLines = plainTextSplit[1...].filter { !$0.isEmpty }
|
||||
|
||||
// separate normal lines (no otp tokens)
|
||||
let normalAdditionalLines = additionalLines.filter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue