diff --git a/Content.Server/Administration/Commands/RoleBanCommand.cs b/Content.Server/Administration/Commands/RoleBanCommand.cs index 8b535977ee..68fbac0334 100644 --- a/Content.Server/Administration/Commands/RoleBanCommand.cs +++ b/Content.Server/Administration/Commands/RoleBanCommand.cs @@ -7,6 +7,8 @@ using Content.Shared.Database; using Content.Shared.Roles; using Robust.Shared.Configuration; using Robust.Shared.Console; +using Robust.Shared.Prototypes; + namespace Content.Server.Administration.Commands; [AdminCommand(AdminFlags.Ban)] @@ -15,6 +17,7 @@ public sealed class RoleBanCommand : IConsoleCommand [Dependency] private readonly IPlayerLocator _locator = default!; [Dependency] private readonly IBanManager _bans = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; public string Command => "roleban"; public string Description => Loc.GetString("cmd-roleban-desc"); @@ -76,6 +79,12 @@ public sealed class RoleBanCommand : IConsoleCommand return; } + if (!_proto.HasIndex(job)) + { + shell.WriteError(Loc.GetString("cmd-roleban-job-parse",("job", job))); + return; + } + var located = await _locator.LookupIdByNameOrIdAsync(target); if (located == null) {