• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

OpenTweenのfork


Commit MetaInfo

修訂c3dff491c511bd9c60fa28bf18dac5b73adae895 (tree)
時間2012-02-18 23:19:55
作者kiri_feather <kiri_feather@user...>
CommiterKimura Youichi

Log Message

画像投稿でNullref出る場合があるようなので対応

Change Summary

差異

--- a/Tween/Connection/Plixi.vb
+++ b/Tween/Connection/Plixi.vb
@@ -55,13 +55,15 @@ Public Class Plixi
5555 Public Function Upload(ByRef filePath As String,
5656 ByRef message As String,
5757 ByVal reply_to As Long) As String Implements IMultimediaShareService.Upload
58+ If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't specified."
59+ If String.IsNullOrEmpty(message) Then message = ""
5860 Dim mediaFile As FileInfo
5961 Try
6062 mediaFile = New FileInfo(filePath)
6163 Catch ex As NotSupportedException
6264 Return "Err:" + ex.Message
6365 End Try
64- If Not mediaFile.Exists Then Return "Err:File isn't exists."
66+ If mediaFile Is Nothing OrElse Not mediaFile.Exists Then Return "Err:File isn't exists."
6567
6668 Dim content As String = ""
6769 Dim ret As HttpStatusCode
@@ -86,6 +88,7 @@ Public Class Plixi
8688 End If
8789 'アップロードまでは成功
8890 filePath = ""
91+ If String.IsNullOrEmpty(url) Then url = ""
8992 'Twitterへの投稿
9093 '投稿メッセージの再構成
9194 If message.Length + url.Length + 1 > 140 Then
--- a/Tween/Connection/TwitPic.vb
+++ b/Tween/Connection/TwitPic.vb
@@ -68,13 +68,15 @@ Public Class TwitPic
6868 Public Function Upload(ByRef filePath As String,
6969 ByRef message As String,
7070 ByVal reply_to As Long) As String Implements IMultimediaShareService.Upload
71+ If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't specified."
72+ If String.IsNullOrEmpty(message) Then message = ""
7173 Dim mediaFile As FileInfo
7274 Try
7375 mediaFile = New FileInfo(filePath)
7476 Catch ex As NotSupportedException
7577 Return "Err:" + ex.Message
7678 End Try
77- If Not mediaFile.Exists Then Return "Err:File isn't exists."
79+ If mediaFile Is Nothing OrElse Not mediaFile.Exists Then Return "Err:File isn't exists."
7880
7981 Dim content As String = ""
8082 Dim ret As HttpStatusCode
@@ -99,6 +101,7 @@ Public Class TwitPic
99101 End If
100102 'アップロードまでは成功
101103 filePath = ""
104+ If String.IsNullOrEmpty(url) Then url = ""
102105 'Twitterへの投稿
103106 '投稿メッセージの再構成
104107 If message.Length + url.Length + 1 > 140 Then
--- a/Tween/Connection/TwitterPhoto.vb
+++ b/Tween/Connection/TwitterPhoto.vb
@@ -68,6 +68,8 @@ Public Class TwitterPhoto
6868 Public Function Upload(ByRef filePath As String,
6969 ByRef message As String,
7070 ByVal reply_to As Long) As String Implements IMultimediaShareService.Upload
71+ If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't specified."
72+ If String.IsNullOrEmpty(message) Then message = ""
7173 Dim mediaFile As FileInfo
7274 Try
7375 mediaFile = New FileInfo(filePath)
--- a/Tween/Connection/imgly.vb
+++ b/Tween/Connection/imgly.vb
@@ -54,13 +54,15 @@ Public Class imgly
5454 Public Function Upload(ByRef filePath As String,
5555 ByRef message As String,
5656 ByVal reply_to As Long) As String Implements IMultimediaShareService.Upload
57+ If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't specified."
58+ If String.IsNullOrEmpty(message) Then message = ""
5759 Dim mediaFile As FileInfo
5860 Try
5961 mediaFile = New FileInfo(filePath)
6062 Catch ex As NotSupportedException
6163 Return "Err:" + ex.Message
6264 End Try
63- If Not mediaFile.Exists Then Return "Err:File isn't exists."
65+ If mediaFile Is Nothing OrElse Not mediaFile.Exists Then Return "Err:File isn't exists."
6466
6567 Dim content As String = ""
6668 Dim ret As HttpStatusCode
@@ -85,6 +87,7 @@ Public Class imgly
8587 End If
8688 'アップロードまでは成功
8789 filePath = ""
90+ If String.IsNullOrEmpty(url) Then url = ""
8891 'Twitterへの投稿
8992 '投稿メッセージの再構成
9093 If message.Length + url.Length + 1 > 140 Then
--- a/Tween/Connection/yfrog.vb
+++ b/Tween/Connection/yfrog.vb
@@ -56,6 +56,7 @@ Public Class yfrog
5656 ByRef message As String,
5757 ByVal reply_to As Long) As String Implements IMultimediaShareService.Upload
5858 If String.IsNullOrEmpty(filePath) Then Return "Err:File isn't exists."
59+ If String.IsNullOrEmpty(message) Then message = ""
5960 'FileInfo作成
6061 Dim mediaFile As FileInfo
6162 Try
@@ -89,8 +90,7 @@ Public Class yfrog
8990 Return "Err:" + ret.ToString
9091 End If
9192
92- If String.IsNullOrEmpty(url) Then Return "Err:Upload failed."
93- If message Is Nothing Then message = ""
93+ If String.IsNullOrEmpty(url) Then url = ""
9494 'アップロードまでは成功
9595 filePath = ""
9696 'Twitterへの投稿