mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add temporary null-check to context menu stuff to hopefully prevent random crashes.
This commit is contained in:
parent
5824d837bc
commit
aa8d3b8f78
1 changed files with 7 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
|
@ -456,11 +456,16 @@ namespace Dalamud.Game.Gui.ContextMenus
|
|||
var redButtonActions = &((AgentContext*)this.agentContextInterface)->Items->RedButtonActions;
|
||||
*(redButtonActions + contextMenuItemIndex) = action;
|
||||
}
|
||||
else
|
||||
else if (((AgentContext*)this.agentContextInterface)->Items != null)
|
||||
{
|
||||
// TODO: figure out why this branch is reached on inventory contexts and why Items is sometimes null.
|
||||
var actions = &((AgentContext*)this.agentContextInterface)->Items->Actions;
|
||||
*(actions + this.FirstContextMenuItemIndex + contextMenuItemIndex) = action;
|
||||
}
|
||||
else
|
||||
{
|
||||
PluginLog.Warning("Context Menu action failed, Items pointer was unexpectedly null.");
|
||||
}
|
||||
|
||||
if (contextMenuItem.Indicator == ContextMenuItemIndicator.Previous)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue