Fixed migration logic.

This commit is contained in:
Michael Bucari-Tovo 2021-06-22 16:55:56 -06:00
parent 8d70d2a95f
commit 919175cc10

View File

@ -237,16 +237,19 @@ namespace LibationLauncher
var accountsPersister = AudibleApiStorage.GetAccountsSettingsPersister(); var accountsPersister = AudibleApiStorage.GetAccountsSettingsPersister();
foreach (var account in accountsPersister.AccountsSettings.Accounts) foreach (var account in accountsPersister?.AccountsSettings?.Accounts)
{ {
var identity = account.IdentityTokens; var identity = account?.IdentityTokens;
if (identity is null)
continue;
if (!string.IsNullOrWhiteSpace(identity.DeviceType) && if (!string.IsNullOrWhiteSpace(identity.DeviceType) &&
!string.IsNullOrWhiteSpace(identity.DeviceSerialNumber) && !string.IsNullOrWhiteSpace(identity.DeviceSerialNumber) &&
!string.IsNullOrWhiteSpace(identity.AmazonAccountId)) !string.IsNullOrWhiteSpace(identity.AmazonAccountId))
continue; continue;
var authorize = new AudibleApi.Authorization.Authorize(identity?.Locale); var authorize = new AudibleApi.Authorization.Authorize(identity.Locale);
try try
{ {