From 6130bae81d461f24d28913854871306c0564576b Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Wed, 3 Jan 2024 22:47:35 +0100 Subject: [PATCH] I don't know what behavior changed here but this fixes the issue. --- Glamourer/Gui/Tabs/AutomationTab/HumanNpcCombo.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Glamourer/Gui/Tabs/AutomationTab/HumanNpcCombo.cs b/Glamourer/Gui/Tabs/AutomationTab/HumanNpcCombo.cs index c3781fc..0eeda59 100644 --- a/Glamourer/Gui/Tabs/AutomationTab/HumanNpcCombo.cs +++ b/Glamourer/Gui/Tabs/AutomationTab/HumanNpcCombo.cs @@ -4,6 +4,7 @@ using System.Linq; using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Utility; using ImGuiNET; +using OtterGui; using OtterGui.Custom; using OtterGui.Log; using OtterGui.Widgets; @@ -80,8 +81,10 @@ public sealed class HumanNpcCombo( switch (kind) { case ObjectKind.BattleNpc: - var nameIds = bNpcNames[id]; - ret.AddRange(nameIds.Select(nameId => (bNpcs[nameId], kind, nameId.Id))); + if (!bNpcNames.TryGetValue(id, out var nameIds)) + continue; + + ret.AddRange(nameIds.SelectWhere(nameId => (bNpcs.TryGetValue(nameId, out var s), (s!, kind, nameId.Id)))); break; case ObjectKind.EventNpc: ret.Add((name, kind, id));