We experience an unhandled NullReferenceException thrown by OnTextInput method of ApplicationMenu class.
An application crash occurs when a user opens Application Menu via mouse click, and attempt to click a menu item access key. The issue is hidden if the user opens the Application Menu via alt + F. Note that we do not use FooterButtons in our application menu.
Tracings show that the exception was thrown in ApplicationMenu.OnTextInput() method, where it attempted to iterate through FooterButtons property's private field of type RibbonControlCollection.
From DotPeek, we could see that the private field is lazy initialized by FooterButtons property's get method, and thus the private field is null if the property get method was never called.
My guess is that the ApplicationMenu tries matching the text input to footer buttons' key access texts, but the code seems missing a null reference check on FooterButtons property's private field.
So far we have adopted a workaround by explicitly calling ApplicationMenu.FooterButtons get method in code-behind to avoid the issue.
However, I do wish that the issue be fixed in the next release, as the workaround looks ugly and confusing.
Code Snippet from DotPeek:
In ApplicationMenu class,
protected override void OnTextInput(TextCompositionEventArgs e)
foreach (UIElement uiElement in (Collection<UIElement>) this.#7ob)
if (uiElement != null && uiElement.IsEnabled && KeyTipService.GetKeyTipAccessText((DependencyObject) uiElement) == keyTipAccessText)
IKeyTipTarget keyTipTarget = uiElement as IKeyTipTarget;
if (keyTipTarget != null)
e.Handled = keyTipTarget.NotifyKeyTipAccessed(keyTipAccessText);
this.#7ob (which is lazy initialized by FooterButtons), was null at the time the crash occurred.