{"record":{"id":"dcbd856d3e1ede37","repo":"peass-ng/PEASS-ng","slug":"mismatching-id-for-trigger-and-lookup","errorCode":null,"errorMessage":"Mismatching Id for trigger and lookup.","messagePattern":"Mismatching Id for trigger and lookup\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs","lineNumber":77,"sourceCode":"        public Trigger this[[NotNull] string triggerId]\n        {\n            get\n            {\n                if (string.IsNullOrEmpty(triggerId))\n                    throw new ArgumentNullException(nameof(triggerId));\n                foreach (var t in this)\n                    if (string.Equals(t.Id, triggerId))\n                        return t;\n                throw new ArgumentOutOfRangeException(nameof(triggerId));\n            }\n            set\n            {\n                if (value == null)\n                    throw new NullReferenceException();\n                if (string.IsNullOrEmpty(triggerId))\n                    throw new ArgumentNullException(nameof(triggerId));\n                if (triggerId != value.Id)\n                    throw new InvalidOperationException(\"Mismatching Id for trigger and lookup.\");\n                var index = IndexOf(triggerId);\n                if (index >= 0)\n                {\n                    var orig = this[index].Clone();\n                    inV2set = true;\n                    try\n                    {\n                        RemoveAt(index);\n                        Insert(index, value);\n                    }\n                    finally\n                    {\n                        inV2set = true;\n                    }\n                    OnNotifyPropertyChanged(IndexerName);\n                    CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, value, orig, index));\n                }\n                else","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs#L59-L95","documentation":"Lookup-failure sentinel in the TriggerCollection string indexer's getter: after iterating all triggers, none has an Id equal to the requested triggerId, so the generic ArgumentOutOfRangeException(nameof(triggerId)) is thrown — the message 'Mismatching Id for trigger and lookup.' documents the intent. The faulting input is the triggerId string; the empty/null case is caught earlier by a separate ArgumentNullException.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TriggerCollection.cs:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the trigger exists first via Contains or by enumerating Ids before indexing by Id","Ensure the Id assigned on the Trigger (its Id property) matches the string passed to the indexer","Catch ArgumentOutOfRangeException and treat it as 'trigger not found' when doing lookup-style access"],"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"}