http://bugzilla.novell.com/show_bug.cgi?id=579241

http://bugzilla.novell.com/show_bug.cgi?id=579241#c0


           Summary: System.Web.HttpFileCollectionWrapper
                    (System.Web.Abstractions.dll) Get method and indexer
                    by name throw exceptions for unfound name/index
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---
           Blocker: ---


Created an attachment (id=342077)
 --> (http://bugzilla.novell.com/attachment.cgi?id=342077)
Suggested fix (based on mono-2.6.1 tarball, but should work on latest SVN)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.9
(KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9

From: http://msdn.microsoft.com/en-us/library/cc680757.aspx

The indexer (this[string name]) for this class, as well as Get(name) are
throwing an ArgumentNullException for unfound files, instead of just returning
null.

The patch I will attach fixes that problem. I implemented similar logic for
Get(index), but I'm unsure if that's really necessary or not, since the proper
IndexOutOfBounds exception will probably get thrown by the inner collection
before it matters.

Reproducible: Always

Steps to Reproduce:
1. Call collection_wrapper["Unfound Name"] or collection_wrapper.Get("Unfound
name") with filename not in the collection.
Actual Results:  
Get an ArgumentNullException from the constructor to HttpPostedFileWrapper.

Expected Results:  
The calls should return null and not throw an exception.

This was needed to get the FubuMVC.HelloWorld example working on mono. I've not
tested FubuMVC extensively yet, but at least the hello world no works with this
change.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to