From f1d721d86920fb1502dd75de9df4fb717f4f1a57 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sat, 2 Sep 2017 17:38:25 +1200 Subject: [PATCH] -Asserted variable in WriteEscapedJavaScriptString is not null --- Src/Newtonsoft.Json/Utilities/JavaScriptUtils.cs | 2 ++ 1 file changed, 2 insertions(+) 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); }