From 38e75fd712aae486be825b0e52e0a2b8ea4e9433 Mon Sep 17 00:00:00 2001 From: Pascal Jacob Date: Sun, 25 Jul 2021 22:30:03 +0200 Subject: [PATCH] Fixed FileNotFoundException during authorization --- .../Managed Authentification/PKCE/PKCE_Authentification.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_Authentification.cs b/Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_Authentification.cs index d0d7d91..185ab26 100644 --- a/Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_Authentification.cs +++ b/Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_Authentification.cs @@ -250,6 +250,10 @@ private PKCETokenResponse LoadPKCEToken() // Load token from File if (!string.IsNullOrEmpty(PKCEConfig.TokenPath)) { + if (!File.Exists(PKCEConfig.TokenPath)) + { + return null; + } string previousToken = File.ReadAllText(PKCEConfig.TokenPath); if (string.IsNullOrEmpty(previousToken)) {