nicko       2005/04/03 11:03:29

  Modified:    src/Util ReadOnlyPropertiesDictionary.cs
  Log:
  Fix for LOG4NET-21. Do not serialise key-value pairs where either the key or 
value is null
  
  Revision  Changes    Path
  1.6       +5 -2      logging-log4net/src/Util/ReadOnlyPropertiesDictionary.cs
  
  Index: ReadOnlyPropertiesDictionary.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Util/ReadOnlyPropertiesDictionary.cs,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ReadOnlyPropertiesDictionary.cs   7 Feb 2005 04:05:50 -0000       1.5
  +++ ReadOnlyPropertiesDictionary.cs   3 Apr 2005 18:03:29 -0000       1.6
  @@ -207,14 +207,17 @@
                {
                        foreach(DictionaryEntry entry in InnerHashtable)
                        {
  +                             string entryKey = entry.Key as string;
  +                             object entryValue = entry.Value;
  +
                                // If value is serializable then we add it to 
the list
  -                             if (entry.Value.GetType().IsSerializable)
  +                             if (entryKey != null && entryValue != null && 
entryValue.GetType().IsSerializable)
                                {
                                        // Store the keys as an Xml encoded 
local name as it may contain colons (':') 
                                        // which are NOT escaped by the Xml 
Serialization framework.
                                        // This must be a bug in the 
serialization framework as we cannot be expected
                                        // to know the implementation details 
of all the possible transport layers.
  -                                     
info.AddValue(XmlConvert.EncodeLocalName(entry.Key as string), entry.Value);
  +                                     
info.AddValue(XmlConvert.EncodeLocalName(entryKey), entryValue);
                                }
                        }
                }
  
  
  

Reply via email to