Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Commit

Permalink
增加对Nothing的检查
Browse files Browse the repository at this point in the history
  • Loading branch information
Berrysoft committed May 15, 2018
1 parent de9a94f commit 4eabc86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TsinghuaNet/Settings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Class Settings
Protected Overrides Function ChangeType(name As XName, value As Object, conversionType As Type) As Object
Select Case name
Case "password"
Return Encoding.ASCII.GetString(Convert.FromBase64String(value))
Return Encoding.ASCII.GetString(Convert.FromBase64String(If(value, String.Empty)))
Case "state"
Dim temp As NetState
If [Enum].TryParse(value, temp) Then
Expand All @@ -60,7 +60,7 @@ Class Settings
End If
Case "language"
Try
Return New CultureInfo(value.ToString())
Return If(value Is Nothing, Nothing, New CultureInfo(value.ToString()))
Catch ex As Exception
Return Nothing
End Try
Expand Down

0 comments on commit 4eabc86

Please sign in to comment.