Bug 57917 - NullReferenceException in ContextActionsCell.OnMenuItemPropertyChanged
Summary: NullReferenceException in ContextActionsCell.OnMenuItemPropertyChanged
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.3.5
Hardware: PC Mac OS
: Normal critical
Target Milestone: ---
Assignee: Jimmy [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-07-03 20:39 UTC by jmelliadis
Modified: 2017-08-01 14:33 UTC (History)
4 users (show)

Tags: ac ios OnMenuItemPropertyChanged
Is this bug a regression?: Yes
Last known good build: 2.3.4.247

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:
Status:
RESOLVED FIXED

Description jmelliadis 2017-07-03 20:39:22 UTC
We recently updated forms to Version 2.3.5.255-pre5 to fix an issue that Android users were experiencing in our application. Now our iOS users are hitting this issue frequently throughout the app. It appears that navigating to a page with context action cells or removing an item with a context action from a list view can cause this issue to happen.


System.NullReferenceExceptionObject reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.ContextActionsCell.OnMenuItemPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) <0x100a4ca70 + 0x00024> in <6516852fe46f4179bc5c05639ebf074c#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) <0x10046d850 + 0x00063> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) <0x1004d71d0 + 0x00023> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) <0x10046f350 + 0x00223> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) <0x10046e610 + 0x00393> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) <0x1004747a0 + 0x005a3> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) <0x100474550 + 0x0011f> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) <0x100472ec0 + 0x000cb> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext) <0x10046eaa0 + 0x000c7> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.ApplyBindings () <0x10046d7c0 + 0x00017> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) <0x10046d6a0 + 0x000f7> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.Cell.OnBindingContextChanged () <0x100498b30 + 0x0005b> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) <0x10046ec70 + 0x0003b> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) <0x10046f350 + 0x00253> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) <0x10046e610 + 0x00393> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) <0x10046f180 + 0x0010b> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) <0x10046d5f0 + 0x0002b> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) <0x10046ccb0 + 0x0002b> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2+<UnhookItem>d__153[TView,TItem].MoveNext () <0x10050b7a0 + 0x00237> in <6857c3e3d8934a01aedef43d5fab1604#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x1002fae20 + 0x00028> in <2f4074c3120b4d80802e10af84b67d41#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) <0x1002fd540 + 0x00053> in <2f4074c3120b4d80802e10af84b67d41#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () <0x100b65140 + 0x00027> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () <0x100b48840 + 0x00023> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) <0x100b6b1a0 + 0x0002b> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) <0x100b6b0e0 + 0x000ab> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#6fc3cb83ccccee8340b1bdab0bcc42f7>:0 
  at iSurvey.iOS.Application.Main (System.String[] args) <0x1000c6de0 + 0x00023> in <00ad93f12df04a12830f473388b6999c#6fc3cb83ccccee8340b1bdab0bcc42f7>:0
Comment 1 Jimmy [MSFT] 2017-07-05 16:34:03 UTC
This should be fixed in 2.3.6-pre1 by this pull request: https://github.com/xamarin/Xamarin.Forms/pull/973
Comment 2 jmelliadis 2017-07-17 14:31:49 UTC
Is there any ETA on when 2.3.6-pre1 will be available? Many of our users are hitting this issue and I don't believe that I can revert back to 2.3.4.247 due to other issues that have been fixed in the latest versions.
Comment 3 jmelliadis 2017-07-18 15:31:23 UTC
Also, will this not be available in the Stable release of v2.3.5?
Comment 4 JorgeG 2017-07-28 06:32:02 UTC
I am suffering that problem, appear in a tabbed scenario, when i back throw the exception, i have xamarin forms v2.3.5.256-pre6
thanks
Comment 5 rfreschi 2017-08-01 00:18:54 UTC
What is the ETA on a Nuget release for 2.3.6-pre1?
Comment 6 Jimmy [MSFT] 2017-08-01 14:33:31 UTC
Hi all, 
We have decided to combine the individual v2.3.5 and v2.3.6 releases into a single v2.4 release. More details about this decision here: https://forums.xamarin.com/discussion/comment/289115/#Comment_289115

This fix will be included in the v2.4 release and we are hoping to have a v2.4 pre-release available later this week for you to try. Thanks!