Author: jpobst
Date: 2008-02-20 11:37:39 -0500 (Wed, 20 Feb 2008)
New Revision: 96267
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
Log:
2008-02-20 Jonathan Pobst <[EMAIL PROTECTED]>
* Application.cs: Guard against an NRE in CompanyName and
ProductName.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2008-02-20 16:12:38 UTC (rev 96266)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2008-02-20 16:37:39 UTC (rev 96267)
@@ -224,11 +224,13 @@
// If there is no [AssemblyCompany], return the
outermost namespace
// on Main ()
if (company == null || company.Length == 0)
- company =
assembly.EntryPoint.DeclaringType.Namespace;
+ if (assembly.EntryPoint != null)
+ company =
assembly.EntryPoint.DeclaringType.Namespace;
// If that doesn't work, return the name of
class containing Main ()
if (company == null || company.Length == 0)
- company =
assembly.EntryPoint.DeclaringType.FullName;
+ if (assembly.EntryPoint != null)
+ company =
assembly.EntryPoint.DeclaringType.FullName;
return company;
}
@@ -290,7 +292,8 @@
// If there is no [AssemblyProduct], return the
name of class
// containing Main ()
if (name == null || name.Length == 0)
- name =
assembly.EntryPoint.DeclaringType.FullName;
+ if (assembly.EntryPoint != null)
+ name =
assembly.EntryPoint.DeclaringType.FullName;
return name;
}
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2008-02-20 16:12:38 UTC (rev 96266)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2008-02-20 16:37:39 UTC (rev 96267)
@@ -1,5 +1,10 @@
2008-02-20 Jonathan Pobst <[EMAIL PROTECTED]>
+ * Application.cs: Guard against an NRE in CompanyName and
+ ProductName.
+
+2008-02-20 Jonathan Pobst <[EMAIL PROTECTED]>
+
* Application.cs: For CompanyName, ProductName, and ProductVersion,
make sure we handle all three cases correctly: attribute is present,
attribute is present but is an empty string, and attribute is not
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches