KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.41k stars 188 forks source link

Typing with project node selected pops exception dialog #676

Closed Scottj1s closed 1 year ago

Scottj1s commented 1 year ago

Typing in the first few characters of a target name (like "re" for rebuild) to auto-navigate is an awesome feature. But if I have a project node selected and type, I get an exception dialog. In fact, this is a general issue - if any top-level node is selected, then typing causes an exception dialog.

Suggestion: If a project node is selected, keystrokes should be processed as if the first child node were selected. If a non-project node is selected, keystrokes should be ignored.



Unexpected exception. Sorry about that.

Please Ctrl+C to copy this text and file an issue at https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/new

System.NullReferenceException: Object reference not set to an instance of an object.

at StructuredLogViewer.Controls.BuildControl.SelectItemByKey(Char ch) in C:\MSBuildStructuredLog\src\StructuredLogViewer\Controls\BuildControl.xaml.cs:line 1202

at StructuredLogViewer.Controls.BuildControl.TreeView_KeyDown(Object sender, KeyEventArgs args) in C:\MSBuildStructuredLog\src\StructuredLogViewer\Controls\BuildControl.xaml.cs:line 1168

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.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

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)

OK

KirillOsenkov commented 1 year ago

Fixed in https://github.com/KirillOsenkov/MSBuildStructuredLog/commit/07030732e6f4f112477a93b77f62e4252e50a551

Thanks. Will deploy later next time we release.

Scottj1s commented 1 year ago

awesome, thanks @KirillOsenkov !