My code looks like this:
cIndex = (int)rand.Next(App.viewablePhrases.Count);
phrase = App.viewablePhrases[cIndex];
Infrequently it's giving me an error:
Application Specific Information:
*** Terminating app due to uncaught exception 'SIGABRT', reason: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'
Xamarin Exception Stack:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1[T].get_Item (System.Int32 ) <0x10047bfc0 + 0x0007b> in <939d99b14d934342858948926287beba#d346c1f46aec0f7ce096300b9d7adc79>:0
at CardsTabViewModel.Random () <0x10138a5d0 + 0x0013b> in <1a94c4e2e6ff49bab0334b2d6333fc29#d346c1f46aec0f7ce096300b9d7adc79>:0
Is there a way I could catch this exception to show more details?