pocheshire / BottomNavigationBar

Bottom Navigation Bar for Xamarin
214 stars 70 forks source link

Crash on tab #80

Open galadril opened 6 years ago

galadril commented 6 years ago

I get a nullexception when clicking on a tab with an (second) badge on it.

Steps to reproduce: 1) Create a badge on a tab (autohide enabled) 2) On the app click on the tab to remove the badge, then go to another tab 3) Then we got a new unread event in our system, we remove the old badge and create a new badge. 4) When you click on the tab the second time.. you get the next exception:

Exception details:

06-11 11:16:02.864 I/MonoDroid(  465): UNHANDLED EXCEPTION:
06-11 11:16:02.903 I/MonoDroid(  465): System.NullReferenceException: Object reference not set to an instance of an object.
06-11 11:16:02.903 I/MonoDroid(  465):   at BottomNavigationBar.BottomBar.HandleClick (Android.Views.View v) [0x00010] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.903 I/MonoDroid(  465):   at BottomNavigationBar.BottomBar+<MakeBadgeForTabAt>c__AnonStorey1.<>m__0 () [0x00011] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.903 I/MonoDroid(  465):   at BottomNavigationBar.Listeners.OnTabClickListener.OnClick (Android.Views.View v) [0x0000d] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.903 I/MonoDroid(  465):   at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x0000f] in <263adecfa58f4c449f1ff56156d886fd>:0 
06-11 11:16:02.903 I/MonoDroid(  465):   at (wrapper dynamic-method) System.Object.be6724ae-3136-4cdf-b24e-8e515650a684(intptr,intptr,intptr)
06-11 11:16:02.923 E/AppCenterCrashes(  465): Unhandled Exception from source=AndroidEnvironment
06-11 11:16:02.923 E/AppCenterCrashes(  465): System.NullReferenceException: Object reference not set to an instance of an object.
06-11 11:16:02.923 E/AppCenterCrashes(  465):   at BottomNavigationBar.BottomBar.HandleClick (Android.Views.View v) [0x00010] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.923 E/AppCenterCrashes(  465):   at BottomNavigationBar.BottomBar+<MakeBadgeForTabAt>c__AnonStorey1.<>m__0 () [0x00011] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.923 E/AppCenterCrashes(  465):   at BottomNavigationBar.Listeners.OnTabClickListener.OnClick (Android.Views.View v) [0x0000d] in <f60603cf39c84bebb4c6ba69e7e8bb64>:0 
06-11 11:16:02.923 E/AppCenterCrashes(  465):   at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x0000f] in <263adecfa58f4c449f1ff56156d886fd>:0 
06-11 11:16:02.923 E/AppCenterCrashes(  465):   at (wrapper dynamic-method) System.Object.be6724ae-3136-4cdf-b24e-8e515650a684(intptr,intptr,intptr)