X2CommunityCore / xcom2-launcher

The Alternative Mod Launcher (AML) is a replacement for the default game launchers from XCOM 2 and XCOM Chimera Squad.
GNU General Public License v3.0
348 stars 51 forks source link

NullReferenceException when initializing settings #169

Open ShadowDemonXZ opened 4 years ago

ShadowDemonXZ commented 4 years ago

Hey all, just installed a new 16gb ram into my pc and now this popped up:

Sentry GUID: 566feb50-3d35-4935-949e-04e8cdadf1fc Message: Object reference not set to an instance of an object. Stack: at XCOM2Launcher.Settings.FromFile(String file) in f:\AML\xcom2-launcher\xcom2-launcher\Classes\Settings.cs:line 161 at XCOM2Launcher.Settings.get_Instance() in f:\AML\xcom2-launcher\xcom2-launcher\Classes\Settings.cs:line 32 at XCOM2Launcher.Program.InitializeSettings() in f:\AML\xcom2-launcher\xcom2-launcher\Program.cs:line 250 at XCOM2Launcher.Program.Main() in f:\AML\xcom2-launcher\xcom2-launcher\Program.cs:line 89

Could anyone help me resolve this problem? #BUG

RevZero commented 4 years ago

It is highly unlikely, that this error has something to do with the RAM upgrade.

Please post your settings.json and AML.log files.

ShadowDemonXZ commented 4 years ago

AML.log

the settings file wont attach

RevZero commented 4 years ago

You probably have to rename the file to something like settings.txt, because GitHub only accepts specific file types as attachment. It would be really interesting to take a look at.

Also, after renaming the settings file, AML should be starting again as it will restore the default settings.

Xymanek commented 4 years ago

You can upload any file to github just by zipping it

RevZero commented 4 years ago
2019-11-17 15:20:34,756 [11] DEBUG | ModList: 283 | Processing Workshop details for EvacAll_WotC
2019-11-17 15:20:34,800 [ 1]  INFO | MainForm: 402 | Mod update BackgroundWorker finished
2019-11-17 15:21:02,716 [ 1]  INFO | XCOM2: 110 | Starting WotC
2019-11-17 15:22:05,129 [ 1]  INFO | XCOM2: 110 | Starting WotC
2019-11-17 15:22:58,849 [ 1]  INFO | XCOM2: 110 | Starting WotC
                                                                                                                                                                                                               2019-11-17 18:29:48,919 [ 1]  INFO | Program:  37 | Application started (AML v1.3.2)
2019-11-17 18:29:49,103 [ 1] DEBUG | GlobalSettings:  64 | Initializing global settings
2019-11-17 18:29:49,103 [ 1] DEBUG | GlobalSettings:  70 | Loading global settings from C:\Users\phili\AppData\Local\AML\AMLSettings.json.
2019-11-17 18:29:49,203 [ 1]  WARN | GlobalSettings:  84 | Deserialization result was NULL.
2019-11-17 18:29:49,203 [ 1]  INFO | GlobalSettings:  99 | Using default settings.
2019-11-17 18:29:49,203 [ 1]  INFO | Program: 217 | AML was upgraded from '0.0.0' to '1.3.2'.
2019-11-17 18:29:58,947 [ 1] DEBUG | GlobalSettings: 109 | Saving global settings to C:\Users\phili\AppData\Local\AML\AMLSettings.json.
2019-11-17 18:29:58,996 [ 1]  INFO | Program: 153 | Initializing Sentry
2019-11-17 18:29:59,193 [ 1]  INFO | Program: 189 | Sentry initialized (566feb50-3d35-4935-949e-04e8cdadf1fc)
2019-11-17 18:29:59,249 [ 1]  WARN | Program:  79 | Failed to detect Steam
2019-11-17 18:30:01,337 [ 1]  INFO | Program:  45 | Shutting down...
2019-11-17 18:30:01,371 [ 1] DEBUG | GlobalSettings: 109 | Saving global settings to C:\Users\phili\AppData\Local\AML\AMLSettings.json.
2019-11-17 18:31:19,291 [ 1]  INFO | Program:  37 | Application started (AML v1.3.2)
2019-11-17 18:31:19,341 [ 1] DEBUG | GlobalSettings:  64 | Initializing global settings
2019-11-17 18:31:19,341 [ 1] DEBUG | GlobalSettings:  70 | Loading global settings from C:\Users\phili\AppData\Local\AML\AMLSettings.json.
2019-11-17 18:31:19,491 [ 1] DEBUG | GlobalSettings: 109 | Saving global settings to C:\Users\phili\AppData\Local\AML\AMLSettings.json.
2019-11-17 18:31:19,539 [ 1]  INFO | Program: 153 | Initializing Sentry
2019-11-17 18:31:19,590 [ 1]  INFO | Program: 189 | Sentry initialized (566feb50-3d35-4935-949e-04e8cdadf1fc)
2019-11-17 18:31:20,499 [ 1] FATAL | Program: 132 | Unhandled exception
System.NullReferenceException: Object reference not set to an instance of an object.
   at XCOM2Launcher.Settings.FromFile(String file) in f:\AML\xcom2-launcher\xcom2-launcher\Classes\Settings.cs:line 161
   at XCOM2Launcher.Settings.get_Instance() in f:\AML\xcom2-launcher\xcom2-launcher\Classes\Settings.cs:line 32
   at XCOM2Launcher.Program.InitializeSettings() in f:\AML\xcom2-launcher\xcom2-launcher\Program.cs:line 250
   at XCOM2Launcher.Program.Main() in f:\AML\xcom2-launcher\xcom2-launcher\Program.cs:line 89
2019-11-17 18:31:42,772 [ 1]  INFO | Program:  89 | Shutting down...

Looking at the log: The user normally used AML for a few days. After the three lines "Starting WotC" (see log above), something went wrong. There were like 200 bytes of 0x00 written to the log, which could indicate some kind of crash, log4net flushing some data out or something. Afterwards, the deserialization of the "AMLSettings.json." failed AND the settings.json threw an "Object reference not set to an instance of an object.", which is both very likely caused by corrupted content.

ShadowDemonXZ commented 4 years ago

here's the settings file in zip form settings.zip

RevZero commented 4 years ago

Huh, that settings file doesn't contain any valid data whatsoever (all 0x00). I really can't tell you what happened there. Just delete the file and AML will restore defaults and try to detect folders and mods.

sentry-io[bot] commented 4 years ago

Sentry issue: XCOM2-LAUNCHER-4C