From c761d4b07cc192a5f0d19465a5a6b7996a154a7c Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 30 Jul 2020 13:55:07 -0400 Subject: [PATCH] fix: don't crash on using delete layout --- HudSwap/PluginUI.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HudSwap/PluginUI.cs b/HudSwap/PluginUI.cs index 3e76c8d..524146a 100644 --- a/HudSwap/PluginUI.cs +++ b/HudSwap/PluginUI.cs @@ -344,8 +344,7 @@ namespace HudSwap { if (layout == Guid.Empty) { return; // FIXME: do something better } - byte[] layoutBytes = this.plugin.config.Layouts[layout]?.Item2; - if (layoutBytes == null) { + if (!this.plugin.config.Layouts.TryGetValue(layout, out Tuple entry)) { return; // FIXME: do something better } this.plugin.hud.WriteLayout(this.plugin.config.StagingSlot, entry.Item2);