From 919175cc100cee646989cb547a59245781057c45 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Tue, 22 Jun 2021 16:55:56 -0600 Subject: [PATCH] Fixed migration logic. --- LibationLauncher/Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LibationLauncher/Program.cs b/LibationLauncher/Program.cs index 3f2d9fe7..f63ca021 100644 --- a/LibationLauncher/Program.cs +++ b/LibationLauncher/Program.cs @@ -237,16 +237,19 @@ namespace LibationLauncher 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) && !string.IsNullOrWhiteSpace(identity.DeviceSerialNumber) && !string.IsNullOrWhiteSpace(identity.AmazonAccountId)) continue; - var authorize = new AudibleApi.Authorization.Authorize(identity?.Locale); + var authorize = new AudibleApi.Authorization.Authorize(identity.Locale); try {