diff --git a/Cmdline/Action/Repo.cs b/Cmdline/Action/Repo.cs index 06ab6ccd62..6d11af4d5c 100644 --- a/Cmdline/Action/Repo.cs +++ b/Cmdline/Action/Repo.cs @@ -328,7 +328,7 @@ private int SetRepositoryPriority(RepoPriorityOptions options) return Exit.BADOPT; } var manager = RegistryManager.Instance(MainClass.GetGameInstance(Manager), repoData); - if (options.priority < 0 || options.priority > manager.registry.Repositories.Count) + if (options.priority < 0 || options.priority >= manager.registry.Repositories.Count) { User.RaiseMessage(Properties.Resources.RepoPriorityInvalid, options.priority, manager.registry.Repositories.Count - 1);