Don't call native API when res.xml does not exist 89/151289/3 preview1-00234
authorJunghoon Park <jh9216.park@samsung.com>
Wed, 20 Sep 2017 10:20:21 +0000 (19:20 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Thu, 21 Sep 2017 10:05:27 +0000 (10:05 +0000)
Change-Id: Idfee3446911c4ed76ed4df7df43d2466ebf3d8b1
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs

index 3212fac..d300c57 100755 (executable)
@@ -15,6 +15,7 @@
  */
 
 using System;
+using System.IO;
 using Tizen.Internals.Errors;
 
 namespace Tizen.Applications
@@ -105,8 +106,22 @@ namespace Tizen.Applications
         public static string TryGetPath(Category category, string id)
         {
             string path;
-            ErrorCode err = AppResourceManagerGet(category, id, out path);
+            ErrorCode err;
+            string res;
+
+            if (Application.Current != null)
+            {
+                res = Application.Current.DirectoryInfo.Resource + "res.xml";
+            }
+            else
+            {
+                res = Interop.AppCommon.AppGetResourcePath() + "res.xml";
+            }
+
+            if (!File.Exists(res))
+                return null;
 
+            err = AppResourceManagerGet(category, id, out path);
             switch (err)
             {
                 case ErrorCode.InvalidParameter: