Fix a bug when getting application metadata info (#436)
authorjeremy-jang <35089715+jeremy-jang@users.noreply.github.com>
Mon, 3 Sep 2018 09:06:26 +0000 (18:06 +0900)
committersemun-lee <35090067+semun-lee@users.noreply.github.com>
Mon, 3 Sep 2018 09:06:26 +0000 (18:06 +0900)
Some applications may have multiple value for one key.
We use dictionary for application metadata, this can cause an exception.
This fix prevents above exception, but this will cause different
behavior with native API.

Change-Id: If2ea80b1655b356ab6d8f49c6afe77d0108774b0
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index f24def4..bb360b4
@@ -207,7 +207,8 @@ namespace Tizen.Applications
                 {
                     if (key.Length != 0)
                     {
-                        metadata.Add(key, value);
+                        if (!metadata.ContainsKey(key))
+                            metadata.Add(key, value);
                     }
                     return true;
                 };