Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash with keystroke after File->New #1863

Open
tigert opened this issue Nov 24, 2024 · 2 comments · May be fixed by #1874
Open

crash with keystroke after File->New #1863

tigert opened this issue Nov 24, 2024 · 2 comments · May be fixed by #1874

Comments

@tigert
Copy link
Contributor

tigert commented Nov 24, 2024

Describe the bug
In general one line is always selected in the grid view of MobiFlight Connector, so when you start typing, you will be writing to the Description column. When you do File->New however, there is initially nothing selected, and pressing any key will cause an exception.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Open MobiFlight Connector
  2. Select File -> New and handle possible "are you sure" dialogs
  3. Observe the grid is empty and even the line with "doubleclick row to add new config" is unselected
  4. Press any key (for example "s")

Expected behavior
The only line should be selected, either after the gridview is cleared upon File->New, or upon the keystroke, which would then get inserted into the Description field.

Actual behavior
Exception. Adding the dump in the first comment.

Details

  • MobiFlight Version: BETA 10.4.0.1
  • FlightSim: irrelevant
  • AddOn: irrelevant
@tigert
Copy link
Contributor Author

tigert commented Nov 24, 2024

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at MobiFlight.UI.Panels.OutputConfigPanel.DataGridViewConfig_KeyUp(Object sender, KeyEventArgs e)
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.DataGridView.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
MFConnector
    Assembly Version: 10.4.0.1
    Win32 Version: 10.4.0.1
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/MFConnector.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9172.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9191.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 13.0.0.0
    Win32 Version: 13.0.3.27908
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Newtonsoft.Json.DLL
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
Newtonsoft.Json.Schema
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.15.28029
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Newtonsoft.Json.Schema.DLL
----------------------------------------
Microsoft.ApplicationInsights
    Assembly Version: 2.21.0.429
    Win32 Version: 2.21.0.00429
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Microsoft.ApplicationInsights.DLL
----------------------------------------
System.Diagnostics.DiagnosticSource
    Assembly Version: 7.0.0.0
    Win32 Version: 7.0.22.51805
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/System.Diagnostics.DiagnosticSource.DLL
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
Microsoft.AI.ServerTelemetryChannel
    Assembly Version: 2.21.0.429
    Win32 Version: 2.21.0.00429
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Microsoft.AI.ServerTelemetryChannel.DLL
----------------------------------------
System.Web
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9191.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
SharpDX.DirectInput
    Assembly Version: 4.2.0.0
    Win32 Version: 4.2.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/SharpDX.DirectInput.DLL
----------------------------------------
SharpDX
    Assembly Version: 4.2.0.0
    Win32 Version: 4.2.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/SharpDX.DLL
----------------------------------------
fsuipcClient
    Assembly Version: 3.3.3.403
    Win32 Version: 3.3.3.403
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/fsuipcClient.DLL
----------------------------------------
XPlaneConnector
    Assembly Version: 1.3.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/XPlaneConnector.DLL
----------------------------------------
netstandard
    Assembly Version: 2.0.0.0
    Win32 Version: 4.8.9032.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll
----------------------------------------
ArcazeHid
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/ArcazeHid.DLL
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
HidSharp
    Assembly Version: 2.1.0.0
    Win32 Version: 2.1.0.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/HidSharp.DLL
----------------------------------------
Midi
    Assembly Version: 1.1.0.0
    Win32 Version: 1.1.0.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Midi.DLL
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CommandMessenger.Transport.Serial
    Assembly Version: 3.7.0.0
    Win32 Version: 3.7.0.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/CommandMessenger.Transport.Serial.DLL
----------------------------------------
CommandMessenger
    Assembly Version: 3.7.1.0
    Win32 Version: 3.7.1.0
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/CommandMessenger.DLL
----------------------------------------
Microsoft.FlightSimulator.SimConnect
    Assembly Version: 10.0.61259.0
    Win32 Version: 10.0.61637.0 (FSX-Xpack.20070926-1421)
    CodeBase: file:///C:/Users/tuoma/AppData/Local/MobiFlight/MobiFlight%20Connector/Microsoft.FlightSimulator.SimConnect.DLL
----------------------------------------
System.Net.Http
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9032.0 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

@tigert
Copy link
Contributor Author

tigert commented Nov 24, 2024

So, on startup the gridview is not in focus, so keystrokes likely go to the main window somewhere.

After File > New the gridview is in focus, and the exception happens.

However if you click either one of the Input / Output tabs, then the exception does not happen, since the focus is no longer on the grid component.

@neilenns neilenns linked a pull request Nov 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant