diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2009-04-15 12:54:10 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2009-04-15 12:54:10 +0400 |
commit | d54e48a2c1c738b64bc35c93a07733fde224d652 (patch) | |
tree | dfcb5e76623d1cdc75603634882e17ada12bde25 /mcs/class/System.XML/System.Xml.XPath | |
parent | a7cbc14542ed93afff61083d901f480e02bbfb96 (diff) |
2009-04-15 Atsushi Enomoto <atsushi@ximian.com>
* Expression.cs : extensions could return null and it should be
regarded as empty node-set, not an error.
svn path=/trunk/mcs/; revision=131738
Diffstat (limited to 'mcs/class/System.XML/System.Xml.XPath')
-rw-r--r-- | mcs/class/System.XML/System.Xml.XPath/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml.XPath/Expression.cs | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mcs/class/System.XML/System.Xml.XPath/ChangeLog b/mcs/class/System.XML/System.Xml.XPath/ChangeLog index 98ca71f48a3..875e8aaf2cc 100644 --- a/mcs/class/System.XML/System.Xml.XPath/ChangeLog +++ b/mcs/class/System.XML/System.Xml.XPath/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Atsushi Enomoto <atsushi@ximian.com> + + * Expression.cs : extensions could return null and it should be + regarded as empty node-set, not an error. + 2009-03-17 Atsushi Enomoto <atsushi@ximian.com> * Expression.cs : gave up another optimization for bug #443090. diff --git a/mcs/class/System.XML/System.Xml.XPath/Expression.cs b/mcs/class/System.XML/System.Xml.XPath/Expression.cs index 4a2f77eb562..f8c4e4c0716 100644 --- a/mcs/class/System.XML/System.Xml.XPath/Expression.cs +++ b/mcs/class/System.XML/System.Xml.XPath/Expression.cs @@ -518,9 +518,12 @@ namespace System.Xml.XPath } if (iterResult != null) return iterResult; + if (o == null) + return new NullIterator (iter); + type = GetReturnType (o); break; } - throw new XPathException ("expected nodeset: "+ToString ()); + throw new XPathException (String.Format ("expected nodeset but was {1}: {0}", ToString (), type)); } protected static XPathResultType GetReturnType (object obj) |