diff --git a/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs b/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs index 32cf9d84..66a81a86 100644 --- a/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs @@ -263,6 +263,8 @@ namespace Newtonsoft.Json.Utilities // copy it over when creating new buffer if (isEscapedUnicodeText) { + Debug.Assert(writeBuffer != null, "Write buffer should never be null because it is set when the escaped unicode text is encountered."); + Array.Copy(writeBuffer, newBuffer, UnicodeTextLength); }