{"record":{"id":"0ec3bc786b13a251","repo":"dotnet/wpf","slug":"int64keyframecollection-0","errorCode":null,"errorMessage":"Int64KeyFrameCollection[{0}]","messagePattern":"Int64KeyFrameCollection\\[(.+?)\\]","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Int64KeyFrameCollection.cs","lineNumber":466,"sourceCode":"            }\n        }\n\n        /// <summary>\n        /// Gets or sets the Int64KeyFrame at a given index.\n        /// </summary>\n        public Int64KeyFrame this[int index]\n        {\n            get\n            {\n                ReadPreamble();\n\n                return _keyFrames[index];\n            }\n            set\n            {\n                if (value == null)\n                {\n                    throw new ArgumentNullException(String.Format(CultureInfo.InvariantCulture, \"Int64KeyFrameCollection[{0}]\", index));\n                }\n\n                WritePreamble();\n\n                if (value != _keyFrames[index])\n                {\n                    OnFreezablePropertyChanged(_keyFrames[index], value);\n                    _keyFrames[index] = value;\n\n                    Debug.Assert(_keyFrames[index] != null);\n\n                    WritePostscript();\n                }\n            }\n        }\n\n        #endregion\n    }","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Int64KeyFrameCollection.cs#L448-L484","documentation":"The Int64KeyFrameCollection indexer setter throws ArgumentNullException with message 'Int64KeyFrameCollection[{index}]' when null is assigned at an index. Null key frames are invalid collection items.","triggerScenarios":"Executing int64KeyFrames[index] = null; on an Int64KeyFrameCollection.","commonSituations":"Programmatic collection building with a null frame from a factory or lookup; data-driven frame generation failing silently.","solutions":["Null-check frames before indexer assignment.","Ensure frame factory/lookup code never returns null without handling.","Use KeyFrames.Add with validated instances."],"exampleFix":"// before\nkeyFrames[i] = frames[i]; // frames[i] may be null\n// after\nif (frames[i] != null) keyFrames[i] = frames[i];","handlingStrategy":"type-guard","validationCode":"if (frame == null)\n    throw new InvalidOperationException($\"No key frame available for index {index}; refusing to insert null into Int64KeyFrameCollection.\");","typeGuard":"bool IsValidFrame(Int64KeyFrame f) => f != null;","tryCatchPattern":"try { keyFrames[index] = frame; }\ncatch (ArgumentNullException ex) when (ex.Message.Contains(\"Int64KeyFrameCollection[\")) {\n    // substitute a valid key frame or log and skip\n}","preventionTips":["Guard frame-producing code against null returns","Validate generated key frames before collection insertion","Test collection construction paths with edge-case data"],"tags":["wpf","animation","null-argument","collection"],"backgroundTag":"null-argument","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}