2023-04-11 19:23:02.326 [Error] NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
Stack: en Intersect.Server.Entities.BankInterface.TryDepositItem(Int32 slot, Int32 amount, Int32 destSlot, Boolean sendUpdate)
en Intersect.Server.Networking.PacketHandler.HandlePacket(Client client, DepositItemPacket packet)
en Intersect.Network.PacketHandlerRegistry.<>c__DisplayClass38_1`2.<CreateWeaklyTypedDelegateForMethodInfo>b__1(IPacketSender packetSender, IPacket packet)
en Intersect.Server.Networking.PacketHandler.ProcessPacket(IPacket packet, Client client)
en Intersect.Server.Networking.Client.HandlePackets()

fix it here

public bool TryDepositItem(int slot, int amount, int destSlot = -1, bool sendUpdate = true)
{
// Validate input
if (slot < 0 || slot >= mPlayer.Items.Count)
{
throw new ArgumentOutOfRangeException(nameof(slot), “Slot is out of range.”);
}

if (amount <= 0)
{
throw new ArgumentException(“Amount must be positive.”, nameof(amount));
}

if (destSlot != -1 && (destSlot < 0 || destSlot >= mBank.Count))
{
throw new ArgumentOutOfRangeException(nameof(destSlot), “DestSlot is out of range.”);
}

// Permission Check
if (mGuild != null)
{
var rank = Options.Instance.Guild.Ranks[Math.Max(0, Math.Min(Options.Instance.Guild.Ranks.Length - 1, mPlayer.GuildRank))];
if (!rank.Permissions.BankDeposit && mPlayer.GuildRank != 0)
{
PacketSender.SendChatMsg(mPlayer, Strings.Guilds.NotAllowedDeposit.ToString(mGuild.Name), ChatMessageType.Bank, CustomColors.Alerts.Error);
return false;
}
}

var itemBase = mPlayer.Items[slot].Descriptor;
if (itemBase == null)
{
return false;
}

var inventorySlot = mPlayer.Items[slot];

if (inventorySlot.ItemId != Guid.Empty)
{
if ((!itemBase.CanBank && mGuild == null) ||
(mGuild != null && !itemBase.CanGuildBank) ||
(mGuild != null && mPlayer.GuildRank != 0))
{
PacketSender.SendChatMsg(mPlayer, Strings.Items.nobank, ChatMessageType.Bank, CustomColors.Items.Bound);
return false;
}

var bankSlot = mBank?[destSlot];

lock (mLock)
{
// if stackable, make sure the user actually has this many items or more.
if (itemBase.IsStackable)
{
if (!mPlayer.CanTakeItem(itemBase.Id, amount))
{
amount = mPlayer.FindInventoryItemQuantity(itemBase.Id);
}
}
else
{
amount = 1;
}

if (bankSlot != null &&
CanStoreItem(new Item(itemBase.Id, amount), destSlot) &&
bankSlot.Descriptor.IsStackable &&
inventorySlot.ItemId == bankSlot.ItemId &&
amount + bankSlot.Quantity <= bankSlot.Descriptor.MaxBankStack)
{
PutItem(new Item(itemBase.Id, amount), destSlot, sendUpdate);
mPlayer.TryTakeItem(itemBase.Id, amount, ItemHandling.Normal, sendUpdate);

if (mGuild != null)
{
DbInterface.Pool.QueueWorkItem(mGuild.Save);
}

return true;
}

if (bankSlot.ItemId != Guid.Empty)
{
destSlot = FindOpenSlot(); // bank slot is full or item is not stackable, find another slot!
}
if (destSlot < 0)
{
PacketSender.SendChatMsg(mPlayer, Strings.Banks.banknospace, ChatMessageType.Bank, CustomColors.Alerts.Error);
return false;
}

PutItem(mPlayer.Items[slot], destSlot, sendUpdate);
mPlayer.Items[slot].Set(Item.None);
mPlayer.EquipmentProcessItemLoss(slot);

if (sendUpdate)
{
PacketSender.SendInventoryItemUpdate(mPlayer, slot);
}

if (mGuild != null)
{
DbInterface.Pool.QueueWorkItem(mGuild.Save);
}

return true;

}
}

PacketSender.SendChatMsg(mPlayer, Strings.Banks.depositinvalid, ChatMessageType.Bank, CustomColors.Alerts.Error);
return false;
}