LemonUIbyLemon / LemonUI

LemonUI for .NET (FiveM, RageMP, RagePluginHook and ScriptHookVDotNet 3)
MIT License
177 stars 40 forks source link

FixIndexIfRequired in NativeListItem<T> might set the index under zero and cause an exception #165

Closed justalemon closed 6 months ago

justalemon commented 6 months ago

[01:14:03] [ERROR] Caught unhandled exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List1.get_Item(Int32 index) at LemonUI.Menus.NativeListItem1.get_SelectedItem() in G:\Grand Theft Auto\LemonUI\LemonUI\Menus\NativeListItem{T}.cs:line 63 at LemonUI.Menus.NativeListItem1.UpdateIndex() in G:\Grand Theft Auto\LemonUI\LemonUI\Menus\NativeListItem{T}.cs:line 159 at LemonUI.Menus.NativeListItem1.Add(Int32 position, T item) in G:\Grand Theft Auto\LemonUI\LemonUI\Menus\NativeListItem{T}.cs:line 202 at LemonUI.Menus.NativeListItem`1.Add(T item) in G:\Grand Theft Auto\LemonUI\LemonUI\Menus\NativeListItem{T}.cs:line 177