OSDN Git Service

サムネイル画像の取得時にキャンセルされると WebException が正常にハンドルされない場合がある問題を修正
authorKimura Youichi <kim.upsilon@bucyou.net>
Fri, 31 Jan 2014 20:48:55 +0000 (05:48 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Fri, 31 Jan 2014 21:19:09 +0000 (06:19 +0900)
OpenTween/Resources/ChangeLog.txt
OpenTween/Thumbnail/Services/Pixiv.cs
OpenTween/Thumbnail/ThumbnailInfo.cs
OpenTween/TweetThumbnail.cs

index 5d80c24..c52c002 100644 (file)
@@ -1,6 +1,7 @@
 更新履歴
 
 ==== Ver 1.1.8-beta1(2014/xx/xx)
+ * FIX: サムネイル画像の取得をキャンセルするとエラーが発生する場合がある問題の修正
 
 ==== Ver 1.1.7(2014/01/16)
  * NEW: ダイレクトメッセージに添付された画像のサムネイル表示に対応
index 98951e2..5b3b4a8 100644 (file)
@@ -61,7 +61,7 @@ namespace OpenTween.Thumbnail.Services
                 client.Headers[HttpRequestHeader.Referer] = this.ImageUrl;
 
                 var task = client.DownloadDataAsync(new Uri(this.ThumbnailUrl), token)
-                    .ContinueWith(t => MemoryImage.CopyFromBytes(t.Result), token);
+                    .ContinueWith(t => MemoryImage.CopyFromBytes(t.Result));
 
                 task.ContinueWith(_ => client.Dispose());
 
index eb41c65..4c90644 100644 (file)
@@ -45,7 +45,7 @@ namespace OpenTween.Thumbnail
             var client = new OTWebClient();
 
             var task = client.DownloadDataAsync(new Uri(this.ThumbnailUrl), token)
-                .ContinueWith(t => MemoryImage.CopyFromBytes(t.Result), token);
+                .ContinueWith(t => MemoryImage.CopyFromBytes(t.Result));
 
             task.ContinueWith(_ => client.Dispose());
 
index 75f26ce..5d0fc97 100644 (file)
@@ -90,7 +90,7 @@ namespace OpenTween
                                 .ContinueWith(t2 =>
                                 {
                                     if (t2.IsFaulted)
-                                        t2.Exception.Flatten().Handle(x => x is WebException || x is InvalidImageException);
+                                        t2.Exception.Flatten().Handle(x => x is WebException || x is InvalidImageException || x is TaskCanceledException);
 
                                     if (t2.IsFaulted || t2.IsCanceled)
                                     {