{"record":{"id":"ff42493eeae16d9e","repo":"peass-ng/PEASS-ng","slug":"index-is-not-a-valid-index-in-the-triggercollectio","errorCode":null,"errorMessage":"Index is not a valid index in the TriggerCollection","messagePattern":"Index is not a valid index in the TriggerCollection","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs","lineNumber":114,"sourceCode":"                    Add(value);\n            }\n        }\n\n        /// <summary>Gets a specified trigger from the collection.</summary>\n        /// <param name=\"index\">The index of the trigger to be retrieved.</param>\n        /// <returns>Specialized <see cref=\"Trigger\"/> instance.</returns>\n        public Trigger this[int index]\n        {\n            get\n            {\n                if (v2Coll != null)\n                    return Trigger.CreateTrigger(v2Coll[++index], v2Def);\n                return Trigger.CreateTrigger(v1Task.GetTrigger((ushort)index));\n            }\n            set\n            {\n                if (index < 0 || Count <= index)\n                    throw new ArgumentOutOfRangeException(nameof(index), index, @\"Index is not a valid index in the TriggerCollection\");\n                var orig = this[index].Clone();\n                inV2set = true;\n                try\n                {\n                    Insert(index, value);\n                    RemoveAt(index + 1);\n                }\n                finally\n                {\n                    inV2set = false;\n                }\n                OnNotifyPropertyChanged(IndexerName);\n                CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, value, orig, index));\n            }\n        }\n\n        object IList.this[int index]\n        {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs#L96-L132","documentation":"Bounds sentinel for the TriggerCollection int indexer: the requested index is negative or >= Count, so the guard throws ArgumentOutOfRangeException before the underlying COM call (v2Coll indexing or v1Task.GetTrigger). The faulting input is the index argument; note the indexer is zero-based while the V2 path internally pre-increments (++index), which is internal detail only.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check index against the collection's Count property (0 <= index < Count) before accessing this[index]","Enumerate the collection with foreach instead of positional indexing when index validity is uncertain"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}