DungeonMasterEngine.GameConsoleContent.HandCommand.PutSubItem C# (CSharp) Method

PutSubItem() private method

private PutSubItem ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        private async Task PutSubItem()
        {
            if (theron.Hand == null)
            {
                var ch = await GetFromItemIndex(theron.PartyGroup);

                if (ch != null)
                {
                    var inventory = await GetFromItemIndex(ch.Body.Storages);
                    if (inventory != null)
                    {
                        var chest = await GetFromItemIndex(inventory.Storage.OfType<IInventory>());
                        if (chest != null)
                        {
                            var itemIndex = await GetItemIndex(chest.Storage);
                            if (itemIndex != null)
                            {
                                var item = chest.TakeItemFrom(itemIndex.Value);
                                if (item != null)
                                    theron.Hand = item;
                                else
                                {
                                    Output.WriteLine("Slot is empty.");
                                }

                            }
                        }
                    }
                }
            }
            else
                Output.WriteLine("Hand is not empty!");
        }