{"record":{"id":"fa43f6dbe6176a15","repo":"dotnet/wpf","slug":"value-cannot-be-null","errorCode":null,"errorMessage":"Value cannot be null.","messagePattern":"Value cannot be null\\.","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/CompoundFile/ContainerUtilities.cs","lineNumber":262,"sourceCode":"                    }\n                    bytesRead += padLength;\n                }\n\n                bytesRead += _int32Size; //// Size of the string length read at the beginning of this method\n\n                return inString;\n            }\n        }\n#endif\n\n        /// <summary>\n        /// Subset of CheckStringAgainstNullAndEmpty - and just checks against null reference.\n        /// </summary>\n        internal static void CheckAgainstNull(object paramRef,\n            string testStringIdentifier)\n        {\n            if (paramRef == null)\n                throw new ArgumentNullException(testStringIdentifier);\n        }\n\n#if !PBTCOMPILER\n        /// <summary>\n        ///     Interprets a single string by treating it as a set of names\n        /// delimited by a special character.  The character is the backslash,\n        /// serving the same role it has served since the original MS-DOS.\n        ///     The individual names are extracted from this string and \n        /// returned as an array of string names.\n        ///\n        ///  string \"images\\button.jpg\" -> string [] { \"images\", \"button.jpg\" }\n        ///\n        /// </summary>\n        /// <param name=\"backSlashPath\">\n        ///     String path to be converted\n        /// </param>\n        /// <returns>\n        ///     The elements of the path as a string array","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/CompoundFile/ContainerUtilities.cs#L244-L280","documentation":"ContainerUtilities.CheckAgainstNull is a shared null-check helper: it throws ArgumentNullException when the supplied paramRef is null, using testStringIdentifier as the parameter name. It fires when a compound-file API (e.g. reading a length-prefixed Unicode string) receives a null argument.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/CompoundFile/ContainerUtilities.cs:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass non-null arguments to ContainerUtilities.CheckAgainstNull call sites (e.g. the string read from the compound file)","Validate data read from the compound file before passing it to helpers","Guard callers such as ReadByteLengthPrefixedDWordPaddedUnicodeString against null results"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}