I am seeing following exception.
System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.Util.StringUtil.memcpyimpl(Byte* src, Byte* dest, Int32 len) at System.Web.Util.StringUtil.UnsafeStringCopy(String src, Int32 srcIndex, Char[] dest, Int32 destIndex, Int32 len) at System.Web.HttpWriter.Write(String s) at System.Web.HttpResponse.Write(String s)
I already have following checks on the context to which I am responding.
return !(context == null || context.Response == null ||
context.Response.OutputStream == null ||
!context.Response.OutputStream.CanWrite);
Can anyone hint on what could be causing this?