Enable nullability in Content.Server (#3685)
This commit is contained in:
@@ -76,11 +76,6 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
|
||||
public override bool Drop(DragDropEventArgs args)
|
||||
{
|
||||
if (args.User == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!args.User.TryGetComponent(out IActorComponent? actor)) return false;
|
||||
|
||||
OpenUserInterface(actor.playerSession);
|
||||
@@ -288,7 +283,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
if (!inventory.HasSlot(slot))
|
||||
return false;
|
||||
|
||||
if (!inventory.TryGetSlotItem(slot, out ItemComponent itemToTake))
|
||||
if (!inventory.TryGetSlotItem(slot, out ItemComponent? itemToTake))
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("{0:They} {0:have} nothing there!", Owner));
|
||||
return false;
|
||||
@@ -319,7 +314,12 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
|
||||
var item = inventory.GetSlotItem(slot);
|
||||
inventory.Unequip(slot, false);
|
||||
userHands.PutInHandOrDrop(item);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
userHands.PutInHandOrDrop(item);
|
||||
}
|
||||
|
||||
UpdateSubscribed();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user