This patch still does not handle situation when attributes==null and node.attributes!=null. Please review the corrected patch. If no one objects, I will commit.
Index: SiteMapNode.cs =================================================================== --- SiteMapNode.cs (revision 59261) +++ SiteMapNode.cs (working copy) @@ -238,7 +238,8 @@ node.title = title; node.description = description; node.roles = new ArrayList (roles); - node.attributes = new NameValueCollection (attributes); + if (attributes != null) + node.attributes = new NameValueCollection (attributes); if (cloneParentNodes && ParentNode != null) node.parent = (SiteMapNode) ParentNode.Clone (true); return node; @@ -262,7 +263,9 @@ foreach (object role in roles) if (!node.roles.Contains (role)) return false; - if ((attributes == null || node.attributes == null) && (attributes != node.attributes)) return false; + if (attributes == null || node.attributes == null) + return (attributes == null && node.attributes == null); + if (attributes.Count != node.attributes.Count) return false; foreach (string k in attributes) > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Konstantin Triger > Sent: Tuesday, April 11, 2006 11:30 > To: mono-devel > Subject: [Mono-dev] PATCH: System.Web/SiteMapNode.cs - fix > NullRef exceptions > > Hello, > > > > Attached a patch fixing NullRefs exceptions. > > If no one objects I'll commit. > > > > Regards, > > Konstantin Triger > > > > _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list