PM-14379: Stop storing 'null' in as the word separator (#4219)

This commit is contained in:
David Perez 2024-11-01 14:03:03 -05:00 committed by GitHub
parent 2eb41e932b
commit 9240fb82e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -351,7 +351,7 @@ class GeneratorViewModel @Inject constructor(
GeneratorState.MainType.Passphrase(
numWords = max(options.numWords, minNumWords),
minNumWords = minNumWords,
wordSeparator = options.wordSeparator.toCharArray().first(),
wordSeparator = options.wordSeparator.toCharArray().firstOrNull(),
capitalize = options.allowCapitalize || policy.capitalize == true,
capitalizeEnabled = policy.capitalize != true,
includeNumber = options.allowIncludeNumber || policy.includeNumber == true,
@ -462,7 +462,7 @@ class GeneratorViewModel @Inject constructor(
val newOptions = options.copy(
type = PasscodeGenerationOptions.PasscodeType.PASSPHRASE,
numWords = passphrase.numWords,
wordSeparator = passphrase.wordSeparator.toString(),
wordSeparator = passphrase.wordSeparator?.toString().orEmpty(),
allowCapitalize = passphrase.capitalize,
allowIncludeNumber = passphrase.includeNumber,
)