Imgur check account type before refresh

This commit is contained in:
Jaex 2015-12-15 10:49:05 +02:00
parent 223d6938ba
commit 6a162fa46c

View file

@ -272,7 +272,8 @@ private UploadResult InternalUpload(Stream stream, string fileName, bool refresh
if (errorData != null)
{
if (refreshTokenOnError && errorData.error.Equals("The access token provided is invalid.", StringComparison.InvariantCultureIgnoreCase) && RefreshAccessToken())
if (UploadMethod == AccountType.User && refreshTokenOnError &&
errorData.error.Equals("The access token provided is invalid.", StringComparison.InvariantCultureIgnoreCase) && RefreshAccessToken())
{
DebugHelper.WriteLine("Imgur access token refreshed, reuploading image.");