Conversation
Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
pandinocoder
requested changes
Feb 5, 2026
|
|
||
| protected override void OnContextMenuOpening(ContextMenu contextMenu) | ||
| { | ||
| if (Globals.BagSlots is not { Length: > 0 } bagSlots) |
Member
There was a problem hiding this comment.
You removed an OOB check?
This one wasn't sufficient to begin with, but a second check should have been added after instead of removed.
if (SlotIndex >= bagSlots.Length)
{
return;
}
Contributor
Author
There was a problem hiding this comment.
this one isn't sufficient either
we need to check if the slot is valid and return early here
if (bagSlots[SlotIndex] is null)
{
return;
}
if (SlotIndex >= bagSlots.Length)
{
return;
} if (bankSlots[SlotIndex] is null)
{
return;
}
if (SlotIndex >= bankSlots.Length)
{
return;
}otherwise the client crashes !
| // Clear out the old options since we might not show all of them | ||
| contextMenu.ClearChildren(); | ||
|
|
||
| if (Globals.BagSlots[SlotIndex] is not { } bagSlot) |
Member
There was a problem hiding this comment.
Replace Globals.BagSlots[SlotIndex] with bagSlots from the first OOBE check
| // Clear out the old options since we might not show all of them | ||
| contextMenu.ClearChildren(); | ||
|
|
||
| if (Globals.BankSlots[SlotIndex] is not { } bankSlot) |
Member
There was a problem hiding this comment.
All of the same comments from the other file
Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #2805