From 65f1a4efe4bc8fabb05b149947d60f74bc608bbe Mon Sep 17 00:00:00 2001 From: Jelle <60387522+JelleInfinity@users.noreply.github.com> Date: Sun, 4 Dec 2022 14:13:20 +0100 Subject: [PATCH] Made the intention of this code more clear --- pkNX.WinForms/MainEditor/EditorPLA.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkNX.WinForms/MainEditor/EditorPLA.cs b/pkNX.WinForms/MainEditor/EditorPLA.cs index cd020fcf..ebac01ed 100644 --- a/pkNX.WinForms/MainEditor/EditorPLA.cs +++ b/pkNX.WinForms/MainEditor/EditorPLA.cs @@ -47,7 +47,9 @@ DataCache loader(GenericEditor form) return tableCache.Cache; } - Action? cb = addEntryCallback is { } x ? () => x.Invoke(tableCache.Root) : null; + Action? cb = null; + if (addEntryCallback != null) + cb = () => addEntryCallback.Invoke(tableCache.Root); using var form = new GenericEditor(loader, getName, title, rand, cb, canSave); form.ShowDialog();