From 082782b2839950326e5cdbb77b644aa7ee695ccc Mon Sep 17 00:00:00 2001 From: Iris System Date: Thu, 30 May 2024 11:18:01 +1200 Subject: [PATCH] fix(bot): fix hid list pad when queryer has no registered system --- PluralKit.Bot/Commands/Lists/ContextListExt.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PluralKit.Bot/Commands/Lists/ContextListExt.cs b/PluralKit.Bot/Commands/Lists/ContextListExt.cs index e6e44cfb..45cad921 100644 --- a/PluralKit.Bot/Commands/Lists/ContextListExt.cs +++ b/PluralKit.Bot/Commands/Lists/ContextListExt.cs @@ -128,8 +128,8 @@ public static class ContextListExt // so run it through a helper that "makes it work" :) eb.WithSimpleLineContent(page.Select(m => { - var leftpad = m.Hid.Length == 5 && ctx.Config.HidListPadding == SystemConfig.HidPadFormat.Left ? " " : ""; - var rightpad = m.Hid.Length == 5 && ctx.Config.HidListPadding == SystemConfig.HidPadFormat.Right ? " " : ""; + var leftpad = m.Hid.Length == 5 && ctx.Config?.HidListPadding == SystemConfig.HidPadFormat.Left ? " " : ""; + var rightpad = m.Hid.Length == 5 && ctx.Config?.HidListPadding == SystemConfig.HidPadFormat.Right ? " " : ""; var ret = $"[`{leftpad}{m.DisplayHid(ctx.Config)}{rightpad}`] **{m.NameFor(ctx)}** "; if (opts.IncludeMessageCount && m.MessageCountFor(lookupCtx) is { } count) @@ -240,8 +240,8 @@ public static class ContextListExt // so run it through a helper that "makes it work" :) eb.WithSimpleLineContent(page.Select(g => { - var leftpad = g.Hid.Length == 5 && ctx.Config.HidListPadding == SystemConfig.HidPadFormat.Left ? " " : ""; - var rightpad = g.Hid.Length == 5 && ctx.Config.HidListPadding == SystemConfig.HidPadFormat.Right ? " " : ""; + var leftpad = g.Hid.Length == 5 && ctx.Config?.HidListPadding == SystemConfig.HidPadFormat.Left ? " " : ""; + var rightpad = g.Hid.Length == 5 && ctx.Config?.HidListPadding == SystemConfig.HidPadFormat.Right ? " " : ""; var ret = $"[`{leftpad}{g.DisplayHid(ctx.Config)}{rightpad}`] **{g.NameFor(ctx)}** "; switch (opts.SortProperty)