diff --git a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs index 94673a23..df117f8c 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs @@ -148,11 +148,11 @@ namespace Newtonsoft.Json.Tests.Linq } [Test] - [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Cannot access child value on Newtonsoft.Json.Linq.JValue.")] public void Children() { JValue v = new JValue(true); var c = v.Children(); + Assert.AreEqual(JEnumerable.Empty, c); } [Test] diff --git a/Src/Newtonsoft.Json/Linq/JToken.cs b/Src/Newtonsoft.Json/Linq/JToken.cs index 600dbe31..6d74db13 100644 --- a/Src/Newtonsoft.Json/Linq/JToken.cs +++ b/Src/Newtonsoft.Json/Linq/JToken.cs @@ -265,7 +265,7 @@ namespace Newtonsoft.Json.Linq /// An of containing the child tokens of this , in document order. public virtual JEnumerable Children() { - throw new InvalidOperationException("Cannot access child value on {0}.".FormatWith(CultureInfo.InvariantCulture, GetType())); + return JEnumerable.Empty; } ///