Bug 43726 - Setting TabbedPage.ItemsSource to Null Causes Crash
Summary: Setting TabbedPage.ItemsSource to Null Causes Crash
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.2
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-08-24 22:10 UTC by Jimmy [MSFT]
Modified: 2016-09-22 13:38 UTC (History)
4 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

repro project (47.05 KB, application/zip)
2016-08-24 22:10 UTC, Jimmy [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jimmy [MSFT] 2016-08-24 22:10:48 UTC
Created attachment 17206 [details]
repro project

### Overview
On Android with AppCompat, setting a TabbedPage ItemsSource to null will cause the app to crash with an ArgumentOutOfRangeException because it tries to scroll to CurrentPage which is also now null.

Stacktrace: https://gist.github.com/jimmgarrido/6175406581b0804b20440c8d9fbe15c4

### Steps to Reproduce
1. Run the attached repro project
2. Switch to a child other than the first
3. Press "Set Null"

### Expected Results
The TabbedPage will be empty with no visible children pages.

### Actual Results
App crashes

### Testing Info
Reproduced on Forms 2.3.1 and 2.3.2-pre1
Comment 3 Jani Lirkki 2016-09-14 12:24:58 UTC
Still reproducible in Xamarin Forms version
Comment 4 Jani Lirkki 2016-09-19 07:01:12 UTC
This is no longer reproducible in Xamarin Forms version Thanks!
Comment 5 Parmendra Kumar 2016-09-22 13:38:43 UTC
I have checked this issue with xamarin.forms version and observed that this issue has been fixed.

Hence closing this issue.