Nullreference exception on Treelistbox

Grids for WPF Forum

Posted 6 years ago by Miguel A.
Version: 18.1.0672
Platform: .NET 4.7
Environment: Windows 10 (64-bit)
Avatar

Hi,

randomly I'm getting a nullreference exception when trying to click on treeitems. It happens after time so I don't know exactly how to reproduce it

 

System.NullReferenceException:
at ActiproSoftware.Windows.Controls.Grids.TreeListBoxItem.OnPointerPressed(Object sender, InputPointerButtonEventArgs e)
at ActiproSoftware.Windows.Input.InputAdapter.#doi(Object #xhb, InputEventArgs #yhb, InputPointerButtonKind #zYi)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 
When debugging at runtime with an external debugging software which disassembles the code (I hope this is oky for you) I found the line which seems to have a null references:

private void OnPointerPressed(object sender, InputPointerButtonEventArgs e)
{
if (e == null || e.Handled || !base.IsEnabled)
{
return;
}
[....]
TreeListBox owner = this.treeNode.Owner; <----- At this line an exception is thrown

 

 

[Modified 6 years ago]

Comments (1)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Miguel,

Yes there should have been a null check on that.  It's the only spot in that method where there wasn't one.  We've fixed it for the next maintenance release.  If you need a preview build in the meantime to work around this, please write our support address.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.