[Tween-svn] [1565] yFrogのNullRef対応

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2011年 6月 28日 (火) 01:52:43 JST


Revision: 1565
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1565
Author:   kiri_feather
Date:     2011-06-28 01:52:43 +0900 (Tue, 28 Jun 2011)

Log Message:
-----------
yFrogのNullRef対応

Modified Paths:
--------------
    trunk/Tween/Connection/yfrog.vb


-------------- next part --------------
Modified: trunk/Tween/Connection/yfrog.vb
===================================================================
--- trunk/Tween/Connection/yfrog.vb	2011-06-27 16:46:21 UTC (rev 1564)
+++ trunk/Tween/Connection/yfrog.vb	2011-06-27 16:52:43 UTC (rev 1565)
@@ -56,6 +56,7 @@
 
     Public Function Upload(ByRef filePath As String,
                ByRef message As String) As String Implements IMultimediaShareService.Upload
+        If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't exists."
         'FileInfo作成
         Dim mediaFile As FileInfo
         Try
@@ -63,7 +64,7 @@
         Catch ex As NotSupportedException
             Return "Err:" + ex.Message
         End Try
-        If Not mediaFile.Exists Then Return "Err:File isn't exists."
+        If mediaFile Is Nothing OrElse Not mediaFile.Exists Then Return "Err:File isn't exists."
 
         Dim content As String = ""
         Dim ret As HttpStatusCode
@@ -87,6 +88,8 @@
             Return "Err:" + ret.ToString
         End If
 
+        If String.IsNullOrEmpty(url) Then Return "Err:Upload failed."
+        If message Is Nothing Then message = ""
         'アップロードまでは成功
         filePath = ""
         'Twitterへの投稿



Tween-svn メーリングリストの案内
アーカイブの一覧に戻る