[MediaPlayer][Non-ACR][Fixed svace issues] 92/185592/1
authorSanghoon Lee <shooney.lee@samsung.com>
Wed, 1 Aug 2018 04:03:38 +0000 (13:03 +0900)
committerSanghoon Lee <shooney.lee@samsung.com>
Wed, 1 Aug 2018 04:03:38 +0000 (13:03 +0900)
Change-Id: I8fdd4e12270dd3c1b53fd8b3ec8952150e5a126c

tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs

index 581bede..8d0a439 100755 (executable)
@@ -30,6 +30,13 @@ namespace Tizen.Multimedia.Tests
             string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
             int index = 0;
             string[] resultArray = StringParser(result);
+
+            if (resultArray == null)
+            {
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "StringParser failed " + result);
+                return;
+            }
+
             foreach (string item in resultArray)
             {
                 switch (item)
@@ -54,17 +61,24 @@ namespace Tizen.Multimedia.Tests
         {
             string result = null;
             string url = path;
+            StreamReader reader = null;
 
             try
             {
-                StreamReader reader = File.OpenText(path);
+                reader = File.OpenText(path);
                 result = reader.ReadToEnd();
             }
             catch (Exception e)
             {
                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
             }
-
+            finally
+            {
+                if (reader != null)
+                {
+                    reader.Dispose();
+                }
+            }
             return result;
         }
         private static string[] StringParser(string TCID)