diff --git a/CHANGELOG.md b/CHANGELOG.md index faa51493..9d208555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - 2.0.8.0 - ?? +* Make sure the MEGA client is logged out before logging in (#881) + #### Version - 2.0.7.0 - 5/28/2020 * Code is now robust when dealing with invasive Anti-virus software. We'll retry deletes/opens if the file is in use * Rework HTTP retries for all sites to reduce the amount of 503 errors we get from LL diff --git a/Wabbajack.Lib/Downloaders/MEGADownloader.cs b/Wabbajack.Lib/Downloaders/MEGADownloader.cs index 657ddcdb..4a1fb2c0 100644 --- a/Wabbajack.Lib/Downloaders/MEGADownloader.cs +++ b/Wabbajack.Lib/Downloaders/MEGADownloader.cs @@ -53,6 +53,15 @@ namespace Wabbajack.Lib.Downloaders { MegaApiClient.AuthInfos authInfos; + try + { + MegaApiClient.Logout(); + } + catch (NotSupportedException ex) + { + // Not logged in, so ignore + } + try { authInfos = MegaApiClient.GenerateAuthInfos(username, password.ToNormalString(), mfa);