From b535946d5c58524207ada9da38235ee9ccb76d58 Mon Sep 17 00:00:00 2001 From: aujault Date: Fri, 16 Dec 2022 09:52:05 +0100 Subject: [PATCH] bug congired --- Blazor/Blazor/Components/Inventory.razor | 2 +- Blazor/Blazor/Components/ItemInventory.razor.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Blazor/Blazor/Components/Inventory.razor b/Blazor/Blazor/Components/Inventory.razor index 690eaa8..29161a9 100644 --- a/Blazor/Blazor/Components/Inventory.razor +++ b/Blazor/Blazor/Components/Inventory.razor @@ -11,7 +11,7 @@ } else { - + } } diff --git a/Blazor/Blazor/Components/ItemInventory.razor.cs b/Blazor/Blazor/Components/ItemInventory.razor.cs index e642e85..607b6c5 100644 --- a/Blazor/Blazor/Components/ItemInventory.razor.cs +++ b/Blazor/Blazor/Components/ItemInventory.razor.cs @@ -28,6 +28,7 @@ namespace Blazor.Components Parent.CurrentDragItem = this.Items; Parent.inventory.inventoryItems[this.Index] = null; this.NoDrop = false; + if (this.Items == null) return; Parent.Actions.Add(new InventoryAction("On drag start",this.Index,Items.item)); Parent.update(); } @@ -40,6 +41,7 @@ namespace Blazor.Components this.Items = Parent.CurrentDragItem; NoDrop = true; Parent.CurrentDragItem = null; + if (this.Items == null) return; Parent.Actions.Add(new InventoryAction("On Drop",this.Index,Items.item)); return; }