Author: mhabersack
Date: 2007-11-02 19:28:48 -0500 (Fri, 02 Nov 2007)
New Revision: 88761
Modified:
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
Log:
2007-11-03 Marek Habersack <[EMAIL PROTECTED]>
* SimpleWebHandlerParser.cs: don't NRE on a null assembly passed
to AddAssembly.
AddAssemblyByName must check the return value of
Assembly.LoadWithPartialName, as the method doesn't throw on
missing assembly, it returns null instead.
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2007-11-03 00:17:08 UTC
(rev 88760)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2007-11-03 00:28:48 UTC
(rev 88761)
@@ -1,5 +1,11 @@
2007-11-03 Marek Habersack <[EMAIL PROTECTED]>
+ * SimpleWebHandlerParser.cs: don't NRE on a null assembly passed
+ to AddAssembly.
+ AddAssemblyByName must check the return value of
+ Assembly.LoadWithPartialName, as the method doesn't throw on
+ missing assembly, it returns null instead.
+
* ClientScriptManager.cs: eventValidationArray is serialized in an
optimized fashion, so that its serialized form occupies only as
many slots as were actually used. It may result in that an array
Modified: trunk/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
2007-11-03 00:17:08 UTC (rev 88760)
+++ trunk/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
2007-11-03 00:28:48 UTC (rev 88761)
@@ -289,6 +289,9 @@
internal virtual void AddAssembly (Assembly assembly, bool
fullPath)
{
+ if (assembly == null)
+ throw new ArgumentNullException ("assembly");
+
if (anames == null)
anames = new Hashtable ();
@@ -329,12 +332,17 @@
return assembly;
}
+ Exception ex = null;
try {
assembly = Assembly.LoadWithPartialName (name);
} catch (Exception e) {
- throw new ParseException (location, "Assembly "
+ name + " not found", e);
+ ex = null;
+ assembly = null;
}
+ if (assembly == null)
+ throw new ParseException (location,
String.Format ("Assembly '{0}' not found", name), ex);
+
AddAssembly (assembly, true);
return assembly;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches