@@ -478,6 +478,10 @@ internal class DictionaryPublishedContent : PublishedContentBase
478
478
// I'm not sure that _properties contains all properties including those without a value,
479
479
// neither that GetProperty will return a property without a value vs. null... @zpqrtbnk
480
480
481
+ // List of properties that will appear in the XML and do not match
482
+ // anything in the ContentType, so they must be ignored.
483
+ static readonly string [ ] IgnoredKeys = { "version" , "isDoc" , "key" } ;
484
+
481
485
public DictionaryPublishedContent (
482
486
IDictionary < string , string > valueDictionary ,
483
487
Func < DictionaryPublishedContent , IPublishedContent > getParent ,
@@ -528,8 +532,8 @@ public DictionaryPublishedContent(
528
532
{
529
533
IPublishedProperty property = null ;
530
534
531
- // must ignore that one
532
- if ( i . Key == "version" || i . Key == "isDoc" ) continue ;
535
+ // must ignore those
536
+ if ( IgnoredKeys . Contains ( i . Key ) ) continue ;
533
537
534
538
if ( i . Key . InvariantStartsWith ( "__" ) )
535
539
{
@@ -540,6 +544,8 @@ public DictionaryPublishedContent(
540
544
{
541
545
// use property type to ensure proper conversion
542
546
var propertyType = _contentType . GetPropertyType ( i . Key ) ;
547
+ if ( propertyType == null )
548
+ throw new Exception ( "Internal error, property '" + i . Key + "' is not a valid property for that type of content." ) ;
543
549
property = new XmlPublishedProperty ( propertyType , false , i . Value ) ; // false :: never preview a media
544
550
}
545
551
0 commit comments