From 44e90a202c1bb5b6d8b4f30f8b06091545faa145 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 17 Dec 2018 17:52:37 +0100 Subject: [PATCH] Keys in property list dictionaries aren't necessarily unique. Fixes xamarin-macios#5277. (#39) (#41) Fixes https://github.com/xamarin/xamarin-macios/issues/5277. --- Xamarin.MacDev/PListObject.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Xamarin.MacDev/PListObject.cs b/Xamarin.MacDev/PListObject.cs index bf9fe86..50ad3c6 100644 --- a/Xamarin.MacDev/PListObject.cs +++ b/Xamarin.MacDev/PListObject.cs @@ -2025,8 +2025,10 @@ public override bool ReadDict (PDictionary dict) ReadObjectHead (); var result = ReadObject (); - if (result != null) - dict.Add (key, result); + if (result != null) { + // Keys are not required to be unique. The last entry wins. + dict [key] = result; + } do { if (reader.NodeType == XmlNodeType.Element && reader.Name == "key")