podsleuth r70 - in trunk: . src/PodSleuth/PropertyList



Author: gburt
Date: Fri Dec 19 18:18:55 2008
New Revision: 70
URL: http://svn.gnome.org/viewvc/podsleuth?rev=70&view=rev

Log:
2008-12-19  Gabriel Burt  <gabriel burt gmail com>

	* src/PodSleuth/PropertyList/PlistDictionary.cs: Ignore duplicate keys in
	a dictionary (BNC #430663)



Modified:
   trunk/ChangeLog
   trunk/src/PodSleuth/PropertyList/PlistDictionary.cs

Modified: trunk/src/PodSleuth/PropertyList/PlistDictionary.cs
==============================================================================
--- trunk/src/PodSleuth/PropertyList/PlistDictionary.cs	(original)
+++ trunk/src/PodSleuth/PropertyList/PlistDictionary.cs	Fri Dec 19 18:18:55 2008
@@ -74,7 +74,11 @@
                 keys.Add(key);
             }
             
-            dict.Add(key, value);
+            if (dict.ContainsKey (key)) {
+                Console.WriteLine ("Warning: ignoring duplicate key: {0} (null? {1} empty? {2})", key, key == null, key == "");
+            } else {
+                dict.Add(key, value);
+            }
         }
         
         public bool Remove(string key)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]