Fix errors
This commit is contained in:
@@ -34,10 +34,10 @@ namespace Content.Server.Labels
|
||||
|
||||
private void AfterInteractOn(EntityUid uid, HandLabelerComponent handLabeler, AfterInteractEvent args)
|
||||
{
|
||||
if (args.Target == null || !handLabeler.Whitelist.IsValid(args.Target))
|
||||
if (args.Target is not {Valid: true} target || !handLabeler.Whitelist.IsValid(target))
|
||||
return;
|
||||
|
||||
AddLabelTo(uid, handLabeler, args.Target, out string? result);
|
||||
AddLabelTo(uid, handLabeler, target, out string? result);
|
||||
if (result != null)
|
||||
handLabeler.Owner.PopupMessage(args.User, result);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Content.Server.Labels
|
||||
|
||||
private void OnExamined(EntityUid uid, PaperLabelComponent comp, ExaminedEvent args)
|
||||
{
|
||||
if (comp.LabelSlot.Item == null)
|
||||
if (comp.LabelSlot.Item is not {Valid: true} item)
|
||||
return;
|
||||
|
||||
if (!args.IsInDetailsRange)
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Labels
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EntityManager.TryGetComponent(comp.LabelSlot.Item, out PaperComponent paper))
|
||||
if (!EntityManager.TryGetComponent(item, out PaperComponent paper))
|
||||
// Assuming yaml has the correct entity whitelist, this should not happen.
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user