tyfon7 / UIFixes

Small QOL fixes for SPTarkov
MIT License
8 stars 1 forks source link

Bug: NullReference in MultiSelectPatches.ShowPreview #26

Closed tyfon7 closed 1 month ago

tyfon7 commented 1 month ago

User states it occurred when shooting in raid (???)

[Exception] : NullReferenceException: Object reference not set to an instance of an object
UIFixes.MultiSelectPatches.ShowPreview (EFT.UI.DragAndDrop.GridView gridView, ItemContextClass itemContext, GStruct413 operation) (at <d5f81597a2db424f99604e20e136d002>:0)
UIFixes.MultiSelectPatches+GridViewCanAcceptPatch.Prefix (EFT.UI.DragAndDrop.GridView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, GStruct413& operation, System.Boolean& __result, EFT.UI.ItemUiContext ___itemUiContext_0) (at <d5f81597a2db424f99604e20e136d002>:0)
(wrapper dynamic-method) EFT.UI.DragAndDrop.GridView.DMD<EFT.UI.DragAndDrop.GridView::CanAccept>(EFT.UI.DragAndDrop.GridView,ItemContextClass,ItemContextAbstractClass,GStruct413&)
(wrapper dynamic-method) EFT.UI.DragAndDrop.GridView.DMD<EFT.UI.DragAndDrop.GridView::HighlightItemViewPosition>(EFT.UI.DragAndDrop.GridView,ItemContextClass,ItemContextAbstractClass,bool)
(wrapper dynamic-method) EFT.UI.DragAndDrop.DraggedItemView.DMD<EFT.UI.DragAndDrop.DraggedItemView::UpdateTargetUnderCursor>(EFT.UI.DragAndDrop.DraggedItemView,IContainer,ItemContextAbstractClass)
(wrapper dynamic-method) EFT.UI.DragAndDrop.ItemView.DMD<EFT.UI.DragAndDrop.ItemView::OnDrag>(EFT.UI.DragAndDrop.ItemView,UnityEngine.EventSystems.PointerEventData)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IDragHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <aeb81aa3ac854058af4b003986e2a1e3>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <aeb81aa3ac854058af4b003986e2a1e3>:0)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
Class358:UnityEngine.ILogHandler.LogException(Exception, Object)
UnityEngine.EventSystems.EventSystem:Update()
tyfon7 commented 1 month ago

I believe this is resolved by properly clearing drawing when the inventory is closed