Fix crash when ID for Item.getItemByID = ""

This commit is contained in:
JappaWakka 2024-02-21 17:46:27 +01:00
parent 48af8b91d7
commit 86d6f706e9
1 changed files with 7 additions and 5 deletions

View File

@ -388,11 +388,13 @@ Public MustInherit Class Item
LoadItemBuffer()
End If
Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair)
Return itemTypePair.Key.Id = CInt(ID)
End Function).Value
If type IsNot Nothing Then
Return CType(Activator.CreateInstance(type), Item)
If ID <> "" Then
Dim type = _itemBuffer.FirstOrDefault(Function(itemTypePair)
Return itemTypePair.Key.Id = CInt(ID)
End Function).Value
If type IsNot Nothing Then
Return CType(Activator.CreateInstance(type), Item)
End If
End If
End If