Fix missing null exception checks for roaming pokes.

This commit is contained in:
jianmingyong 2016-09-30 04:16:55 +08:00
parent 8b938cbf90
commit 8f1843a042
1 changed files with 5 additions and 2 deletions

View File

@ -251,8 +251,11 @@
If TempPoke.Count > 0 And RoamingPokeName.Count > 0 Then
For Each Pokes As String In RoamingPokeName
Dim MapObject As Roaming = (From p As Roaming In TempPoke Where p.Name = Pokes Order By p.Distance Ascending).ElementAt(TempPoke(0).getSkipIndex)
RoamingPoke.Add(MapObject)
Dim MapObject As List(Of Roaming) = (From p As Roaming In TempPoke Where p.Name = Pokes Order By p.Distance Ascending).ToList()
If MapObject IsNot Nothing AndAlso Not MapObject.Count = 0 Then
RoamingPoke.Add(MapObject.ElementAt(MapObject(0).getSkipIndex))
End If
Next
End If
End Sub