[Mono-bugs] [Bug 406763] New: NullReferenceException on "new Bitmap(null)"

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 7 09:23:15 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=406763


           Summary: NullReferenceException on "new Bitmap(null)"
           Product: Mono: Class Libraries
           Version: SVN
          Platform: 32bit
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: daniel.grunwald at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Run the following code:
  Stream s = null;
  Bitmap bmp = new Bitmap(s);

Expected result:
System.ArgumentException: Value of 'null' is not valid for 'stream'.

Actual result:
System.NullReferenceException: Object reference not set to an instance of an
object
  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000] in
/home/daniel/mono/mcs/class/System.Drawing/System.Drawing/Image.cs:266 
  at System.Drawing.Bitmap..ctor (System.IO.Stream stream, Boolean useIcm)
[0x00006] in
/home/daniel/mono/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:99 
  at System.Drawing.Bitmap..ctor (System.IO.Stream stream) [0x00000] in
/home/daniel/mono/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs:1 
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
(System.IO.Stream)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list