Server Error in '/' Application.

Buffer cannot be null.
Parameter name: buffer

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Buffer cannot be null.
Parameter name: buffer

Source Error:


Line 188:    public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn)
Line 189:    {
Line 190:        MemoryStream ms = new MemoryStream(byteArrayIn);
Line 191:        System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
Line 192:        return returnImage;

Source File: d:\home\styl-moto.com\italiamoto.it\scripts\image_thumbnail.aspx.cs    Line: 190

Stack Trace:


[ArgumentNullException: Buffer cannot be null.
Parameter name: buffer]
   System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +7904823
   System.IO.MemoryStream..ctor(Byte[] buffer) +6
   scripts_image_thumbnail.byteArrayToImage(Byte[] byteArrayIn) in d:\home\styl-moto.com\italiamoto.it\scripts\image_thumbnail.aspx.cs:190
   scripts_image_thumbnail.Page_Load(Object sender, EventArgs e) in d:\home\styl-moto.com\italiamoto.it\scripts\image_thumbnail.aspx.cs:170
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8974