Change an exception to an assertion, since I can't hit it in tests

This commit is contained in:
Antony Male 2014-05-26 19:00:10 +01:00
parent 7203b02cdf
commit 7bdafdc04a
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -41,8 +42,7 @@ namespace Stylet
/// </summary> /// </summary>
protected virtual void EnsureItem(T newItem) protected virtual void EnsureItem(T newItem)
{ {
if (newItem == null) Debug.Assert(newItem != null);
throw new ArgumentNullException("newItem");
var newItemAsChild = newItem as IChild; var newItemAsChild = newItem as IChild;
if (newItemAsChild != null && newItemAsChild.Parent != this) if (newItemAsChild != null && newItemAsChild.Parent != this)