OSDN Git Service

HttpTwitter.SendDirectMessageメソッドをTwitterApiクラスに置き換え
[opentween/open-tween.git] / OpenTween / Connection / HttpVarious.cs
index 08094f7..f7cfeea 100644 (file)
@@ -48,7 +48,7 @@ namespace OpenTween
                 req.AllowAutoRedirect = false;
                 string data;
                 Dictionary<string, string> head = new Dictionary<string, string>();
-                HttpStatusCode ret = GetResponse(req, out data, head);
+                GetResponse(req, out data, head);
 
                 string location;
                 return head.TryGetValue("Location", out location)
@@ -63,7 +63,7 @@ namespace OpenTween
 
         public Image GetImage(Uri url)
         {
-            return GetImage(url.ToString());
+            return GetImage(url.AbsoluteUri);
         }
 
         public Image GetImage(string url)
@@ -278,11 +278,7 @@ namespace OpenTween
             }
             catch (Exception)
             {
-                if (bmp != null)
-                {
-                    bmp.Dispose();
-                    bmp = null;
-                }
+                bmp?.Dispose();
 
                 bmp = new Bitmap(width, height);
                 bmp.Tag = img.Tag;
@@ -293,7 +289,7 @@ namespace OpenTween
             }
             finally
             {
-                if (bmp != null) bmp.Dispose();
+                bmp?.Dispose();
                 img.Dispose();
             }
         }