[Calendar] Fix error exception, list cursor goes to first when list is created. 46/153646/4
authorJeesun Kim <iamjs.kim@samsung.com>
Fri, 29 Sep 2017 04:35:25 +0000 (13:35 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Tue, 10 Oct 2017 02:29:15 +0000 (11:29 +0900)
Change-Id: Id8cf15e5ab4b726ad6b497f51d03ca8b35ba0571

src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs
src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs

index 4430b45..ce1015a 100644 (file)
@@ -32,6 +32,13 @@ namespace Tizen.Pims.Calendar
         {
             _listHandle = handle;
 
+            int error = Interop.List.First(_listHandle);
+            if (CalendarError.None != (CalendarError)error)
+            {
+                Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error);
+                throw CalendarErrorFactory.GetException(error);
+            }
+
             _memoryPressure += this.Count * CalendarViews.Record.AverageSize;
             GC.AddMemoryPressure(_memoryPressure);
         }
index 980903c..050e7a8 100644 (file)
@@ -109,6 +109,11 @@ namespace Tizen.Pims.Calendar
         /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
         public void SetProjection(uint[] propertyIdArray)
         {
+            if (propertyIdArray == null)
+            {
+                throw new ArgumentException("Invalid Parameters Provided");
+            }
+
             int error = Interop.Query.SetProjection(_queryHandle, propertyIdArray, propertyIdArray.Length);
             if (CalendarError.None != (CalendarError)error)
             {