thomasakarlsen / TruckersMP-Launcher

Unoffical TruckersMP launcher
MIT License
15 stars 9 forks source link

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

Open Bluscream opened 7 years ago

Bluscream commented 7 years ago

This always happens when I click on Settings image

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 truckersmplauncher.Settings..ctor()
   at truckersmplauncher.Main.Settings_btn_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.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.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
truckersmplauncher
    Assembly Version: 1.3.3.7
    Win32 Version: 1.3.3.7
    CodeBase: file:///E:/Steam/steamapps/common/Euro%20Truck%20Simulator%202/TMPLauncher.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    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.6.1586.0 built by: NETFXREL2
    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.6.1586.0 built by: NETFXREL2
    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.6.1586.0 built by: NETFXREL2
    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.6.1586.0 built by: NETFXREL2
    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.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 4.5.0.0
    Win32 Version: 1.3.3.7
    CodeBase: file:///E:/Steam/steamapps/common/Euro%20Truck%20Simulator%202/TMPLauncher.exe
----------------------------------------

************** 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.
thomasakarlsen commented 7 years ago

I have a feeling I know what causes this error, I'll investigate the bug further and release a fix for the next update!

thomasakarlsen commented 7 years ago

I have reason to belive this issue is related to the ETS2/ATS Configuration editor part of the settings dialog. I will have it fixed for the next update to stop it from crashing.

Quick question, have you changed your game "home path" (where the game stores your profiles, etc)?

Bluscream commented 7 years ago

image yes :D

Bluscream commented 7 years ago

but I have it hardlinked to Documents image

Bluscream commented 7 years ago

Some more info for you ♥ image

Bluscream commented 7 years ago

OK, now it works. The problem was that I did not hardlink my ATS homedir to Documents

https://github.com/TruckerMP/TruckersMP-Launcher/commit/810da580049f2a43f451d3c65777191fdb5496cc#diff-46639b9ab78dbf6f7a83556dbf380cefR179

thomasakarlsen commented 7 years ago

Yeah, was about to say. I will to some changes however to make sure it doesnt try to load files which do not exists as thats what the issue here was.

Bluscream commented 7 years ago

You should also try catch the radio stream cause when it fails the app crashes

Bluscream commented 7 years ago

Any news on this whole thing?

thomasakarlsen commented 7 years ago

As I've said earlier progress is slow due to real life, and other projects that have taken priority.