[Mono-dev] PATCH: System.Web/SiteMapNode.cs - fix NullRefexceptions
Andrew Skiba
andrews at mainsoft.com
Tue Apr 11 12:22:20 EDT 2006
Please review the patch including the testcase. Thank you.
> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf
> Of Chris Toshok
> Sent: Tuesday, April 11, 2006 15:09
> To: Andrew Skiba
> Cc: mono-devel
> Subject: RE: [Mono-dev] PATCH: System.Web/SiteMapNode.cs -
> fix NullRefexceptions
>
> also please add a testcase for this.
>
> Chris
> On Tue, 2006-04-11 at 03:23 -0700, Andrew Skiba wrote:
> > 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
> > >
> > >
> > >
> > >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SiteMapNode.patch
Type: application/octet-stream
Size: 4577 bytes
Desc: SiteMapNode.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060411/a3b0f55a/attachment.obj
More information about the Mono-devel-list
mailing list