Added some extra properties/functions to DynamicNull to provide a way to check to see if a child doc type actually exists.
.HasProperty will check for a property existence but because the child types are returned as DynamicNull, you couldn't check for null equality. Use DynamicNull's .IsNull (true) or .HasValue (false) or .Count() (0) or a typeof check
This commit is contained in:
@@ -26,6 +26,10 @@ namespace umbraco.MacroEngines
|
||||
{
|
||||
return this;
|
||||
}
|
||||
public int Count()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Empty;
|
||||
@@ -35,5 +39,19 @@ namespace umbraco.MacroEngines
|
||||
result = this;
|
||||
return true;
|
||||
}
|
||||
public bool IsNull
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public bool HasValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user