System.ArgumentOutOfRangeException when ItemSource has no items

when my observable collection is empty the app crashes and i get

var thumbs = await _dataClient.GetThumbNails("ivitem", _item.code);
AttachmentThumbs = new ObservableCollection<AttachmentThumb>(thumbs); //AttachmentThumbs has zero items

Error:

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index

08-31 16:36:44.626 I/MonoDroid(32104): UNHANDLED EXCEPTION:
08-31 16:36:44.626 I/MonoDroid(32104): System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
08-31 16:36:44.626 I/MonoDroid(32104): Parameter name: index
08-31 16:36:44.626 I/MonoDroid(32104):   at (wrapper dynamic-method) System.Object:a958ace6-0f30-46a9-b4ec-1d61d950373e (intptr,intptr,intptr,int)
08-31 16:36:44.626 I/MonoDroid(32104):   at (wrapper native-to-managed) System.Object:a958ace6-0f30-46a9-b4ec-1d61d950373e (intptr,intptr,intptr,int)
08-31 16:36:44.626 I/MonoDroid(32104):   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
08-31 16:36:44.626 I/MonoDroid(32104):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (JniObjectReference instance, JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008f] in /Users/builder/data/lanes/3540/1cf254db/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:12079 
08-31 16:36:44.626 I/MonoDroid(32104):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00022] in /Users/builder/data/lanes/3540/1cf254db/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:41 
08-31 16:36:44.626 I/MonoDroid(32104):   at Android.Views.ViewGroup.Layout (Int32 l, Int32 t, Int32 r, Int32 b) [0x00055] in /Users/builder/data/lanes/3540/1cf254db/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3188 
08-31 16:36:44.626 I/MonoDroid(32104):   at Xamarin.Forms.Platform.Android.ViewRenderer`2[TView,TNativeView].OnLayout (Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) [0x00059] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\ViewRenderer.cs:132 
08-31 16:36:44.626 I/MonoDroid(32104):   at Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (IntPtr jnienv, IntPtr native__this, Boolean p0, Int32 p1, Int32 p2, Int32 p3, Int32 p4) [0x00008] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:240 
08-31 16:36:44.626 I/MonoDroid(32104):   at (wrapper dynamic-method) System.Object:8f29c273-89f2-4ac4-b79f-1cc7fe1f46d1 (intptr,intptr,bool,int,int,int,int)

3 Replies

HM Hemalatha Marikumar Syncfusion Team September 1, 2016 12:04 PM UTC

Hi Giorgos Papadakis,

Thanks for contacting Syncfusion Support.

We were able to reproduce the issue "Rotator gets crash with empty collection in ItemSource". A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/

Regards,
Hemalatha M.R.


RD Rik Dekkers October 17, 2016 01:41 PM UTC

Hi

Looks like I have te same issue. Is there already an update on the issue or do I need to create a support incident also?

Thanks


HM Hemalatha Marikumar Syncfusion Team October 18, 2016 05:44 AM UTC

Hi Rik Dekkers,

Thanks for contacting Syncfusion Support.

We have already been fixed the reported issue " Getting ArgumentOutOfRangeException in SfRotator control”. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/

Regards,
Hemalatha M.R.

Loader.
Up arrow icon