[Mono-dev] PATCH: System.Web/SiteMapNode.cs - fix NullRef exceptions
Andrew Skiba
andrews at mainsoft.com
Tue Apr 11 06:23:59 EDT 2006
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: mono-devel-list-bounces at lists.ximian.com
> [mailto:mono-devel-list-bounces at lists.ximian.com] 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
>
>
>
>
More information about the Mono-devel-list
mailing list