mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-03 12:04:48 +02:00
Fix crash when ID for Item.getItemByID = ""
This commit is contained in:
parent
48af8b91d7
commit
86d6f706e9
@ -388,12 +388,14 @@ Public MustInherit Class Item
|
|||||||
LoadItemBuffer()
|
LoadItemBuffer()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ID <> "" Then
|
||||||
Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair)
|
Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair)
|
||||||
Return itemTypePair.Key.Id = CInt(ID)
|
Return itemTypePair.Key.Id = CInt(ID)
|
||||||
End Function).Value
|
End Function).Value
|
||||||
If type IsNot Nothing Then
|
If type IsNot Nothing Then
|
||||||
Return CType(Activator.CreateInstance(type), Item)
|
Return CType(Activator.CreateInstance(type), Item)
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Return Nothing
|
Return Nothing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user