diff options
author | Marek Habersack <grendel@twistedcode.net> | 2010-02-18 15:37:59 +0300 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2010-02-18 15:37:59 +0300 |
commit | ddb382c14cf21d7585965957f32bd5d16c5bdf80 (patch) | |
tree | 2d41c54581b83bb8f5cd6be32319661c6327d39f /mcs/class/System.Web.Abstractions/System.Web | |
parent | 26f59283aa17290acaf3fe777a2ba7f0e61be31f (diff) |
Backport of r151978
svn path=/branches/mono-2-6/mcs/; revision=151979
Diffstat (limited to 'mcs/class/System.Web.Abstractions/System.Web')
-rw-r--r-- | mcs/class/System.Web.Abstractions/System.Web/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/mcs/class/System.Web.Abstractions/System.Web/ChangeLog b/mcs/class/System.Web.Abstractions/System.Web/ChangeLog index 5988165d20d..8f0061ed217 100644 --- a/mcs/class/System.Web.Abstractions/System.Web/ChangeLog +++ b/mcs/class/System.Web.Abstractions/System.Web/ChangeLog @@ -1,3 +1,10 @@ +2010-02-18 Marek Habersack <mhabersack@novell.com> + + * HttpFileCollectionWrapper.cs: Get (string) and this [string] + don't throw ArgumentNullException for non-existing entries. Fixes + bug #579241. Patch from Peter Johanson <peter@peterjohanson.com>, + thanks! + 2009-07-30 Gonzalo Paniagua Javier <gonzalo@novell.com> * HttpResponseWrapper.cs: removed a few TODO/NotImplemented. diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs index adabe2f09a8..2ff06735fb7 100644 --- a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs +++ b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs @@ -91,12 +91,20 @@ namespace System.Web public override HttpPostedFileBase Get (int index) { - return new HttpPostedFileWrapper (w.Get (index)); + HttpPostedFile file = w.Get (index); + if (file == null) + return null; + + return new HttpPostedFileWrapper (file); } public override HttpPostedFileBase Get (string name) { - return new HttpPostedFileWrapper (w.Get (name)); + HttpPostedFile file = w.Get (name); + if (file == null) + return null; + + return new HttpPostedFileWrapper (file); } public override IEnumerator GetEnumerator () |