Skip to content

[BUG] NullReferenceException during closing #63

@Hancho2009

Description

@Hancho2009

Summary

Exception in the Melon Loader Console Window when closing the game.

Game Version

Other (specify in Additional Context)

S1API Version

3.0.0

MelonLoader Version

0.7.0

Runtime Environment

IL2CPP (Regular)

Steps to Reproduce

  1. create new save
  2. run to warehouse
  3. talk to doris
  4. quit game
  5. check melon loader console

Expected vs Actual Behavior

Expected: No Exception thrown during exiting the game
Actual:: NullReferenceException

MelonLoader Log

Melon Loader 0.7.0 Il2cpp
[20:48:18.727] ------------------------------
[20:48:18.729] MelonLoader v0.7.0 Open-Beta
[20:48:18.730] OS: Windows 10
[20:48:18.730] Hash Code: 72EB65FC06D8CACD193CD21D9E7D708128C85D36C429D62C2BE9BB24217EF1EC
[20:48:18.730] ------------------------------
[20:48:18.730] Game Type: Il2cpp
[20:48:18.730] Game Arch: x64
[20:48:18.731] ------------------------------
[20:48:18.731] Command-Line:
[20:48:18.731] ------------------------------
[20:48:18.731] Core::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public
[20:48:18.731] Game::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public
[20:48:18.731] Game::DataPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\Schedule I_Data
[20:48:18.731] Game::ApplicationPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\Schedule I.exe
[20:48:18.731] Runtime Type: net6
[20:48:18.832] ------------------------------
[20:48:18.832] Game Name: Schedule I
[20:48:18.833] Game Developer: TVGS
[20:48:18.834] Unity Version: 2022.3.62f2
[20:48:18.834] Game Version: 0.4.4f10
[20:48:18.834] ------------------------------

[20:48:19.314] Preferences Loaded!

[20:48:19.322] Loading UserLibs...
[20:48:19.324] 0 UserLibs loaded.

[20:48:19.324] Loading Plugins...
[20:48:19.334] ------------------------------
[20:48:19.337] Melon Assembly loaded: '.\Plugins\S1APILoader.MelonLoader.dll'
[20:48:19.337] SHA256 Hash: '391CB7705F235DEDE199C495EB86A21B1F319D6C45A640A1E7436680F2333628'

[20:48:19.357] ------------------------------
[20:48:19.357] S1APILoader v2.5.0
[20:48:19.358] by KaBooMa & Bars
[20:48:19.358] Assembly: S1APILoader.MelonLoader.dll
[20:48:19.358] ------------------------------
[20:48:19.359] ------------------------------
[20:48:19.359] 1 Plugin loaded.

[20:48:20.082] [S1APILoader] Loading S1API for Il2Cpp...
[20:48:20.083] [S1APILoader] Successfully loaded S1API for Il2Cpp!
[20:48:20.083] Loading Il2CppAssemblyGenerator...
[20:48:20.118] [Il2CppAssemblyGenerator] Contacting RemoteAPI...
[20:48:20.251] [Il2CppAssemblyGenerator] Game Not Found on RemoteAPI Host (https://api.melonloader.com/api/v1/game/schedule-i)
[20:48:20.251] [Il2CppAssemblyGenerator] RemoteAPI.DumperVersion = null
[20:48:20.252] [Il2CppAssemblyGenerator] RemoteAPI.ObfuscationRegex = null
[20:48:20.252] [Il2CppAssemblyGenerator] RemoteAPI.MappingURL = null
[20:48:20.252] [Il2CppAssemblyGenerator] RemoteAPI.MappingFileSHA512 = null
[20:48:20.255] [Il2CppAssemblyGenerator] Using Cpp2IL Version: 2022.1.0-pre-release.19
[20:48:20.255] [Il2CppAssemblyGenerator] Using Il2CppInterop Version = 1.4.6-ci.579+9d4599dc78d69ede49a2ee96a1ccf41eec02db5b
[20:48:20.256] [Il2CppAssemblyGenerator] Using Unity Dependencies Version = 2022.3.62
[20:48:20.256] [Il2CppAssemblyGenerator] Using Deobfuscation Regex = null
[20:48:20.257] [Il2CppAssemblyGenerator] Cpp2IL is up to date.
[20:48:20.257] [Il2CppAssemblyGenerator] Cpp2IL.Plugin.StrippedCodeRegSupport is up to date.
[20:48:20.257] [Il2CppAssemblyGenerator] UnityDependencies is up to date.
[20:48:20.257] [Il2CppAssemblyGenerator] Checking GameAssembly...
[20:48:20.344] [Il2CppAssemblyGenerator] Assembly is up to date. No Generation Needed.

[20:48:20.345] Loading Mods...
[20:48:20.363] ------------------------------
[20:48:20.372] Melon Assembly loaded: '.\Mods\S1API.Il2Cpp.MelonLoader.dll'
[20:48:20.372] SHA256 Hash: '96F5A3086589440C53FB92E5CEA3DF7BCDF087ED8BA13D57832C09BB0F4DB46A'

[20:48:20.612] ------------------------------
[20:48:20.612] S1API (Forked by Bars) v3.0.0
[20:48:20.613] by KaBooMa
[20:48:20.613] Assembly: S1API.Il2Cpp.MelonLoader.dll
[20:48:20.613] ------------------------------
[20:48:20.614] ------------------------------
[20:48:20.614] 1 Mod loaded.

[20:48:21.546] [Il2CppInterop] Class::Init signatures have been exhausted, using a substitute!
[20:48:21.629] [Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[20:48:21.673] [Il2CppInterop] Registered mono type MelonLoader.Support.MonoEnumeratorWrapper in il2cpp domain
[20:48:21.702] [Il2CppInterop] Registered mono type MelonLoader.Support.SM_Component in il2cpp domain
[20:48:21.709] Support Module Loaded: C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\MelonLoader\Dependencies\SupportModules\Il2Cpp.dll
[20:48:21.742] [Il2CppInterop] Registered mono type S1API.TVApp.TVAppUpdateHandler in il2cpp domain
[20:48:21.769] [Il2CppInterop] Registered mono type S1API.PhoneApp.PhoneAppButtonHandler in il2cpp domain
[20:48:21.794] [Il2CppInterop] Registered mono type S1API.Internal.Phone.AppIconsRedirect in il2cpp domain
[20:48:21.894] [Il2CppInterop] Registered mono type S1API.Internal.Items.EquippableUseCallback in il2cpp domain
[20:48:21.926] [Il2CppInterop] Registered mono type S1API.Internal.Entities.NPCPrefabIdentity in il2cpp domain
[20:49:27.638] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[20:49:27.638] [UnityExceptionTrace] [Unity] stack trace:
ScheduleOne.NPCs.NPCMovement+<FaceDirection_Process>d__161.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

[20:49:28.043] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[20:49:28.043] [UnityExceptionTrace] [Unity] stack trace:
UnityEngine.Component.GetComponentInParent (System.Type t, System.Boolean includeInactive) (at <00000000000000000000000000000000>:0)
UnityEngine.Component.GetComponentInParent[T] () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.GetReferences () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.End () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCSignal_UseATM+<<Purchase>g__Purchase|14_0>d.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
Melon Loader 0.7.2 Mono
[20:29:42.890] ------------------------------
[20:29:42.908] MelonLoader v0.7.2 Open-Beta
[20:29:42.908] OS: Windows 10
[20:29:42.908] Hash Code: 9DA4175149E7EBA5F67511461A658D15CD062C287E34FC9A03B1EFC8FDC8D21C
[20:29:42.908] ------------------------------
[20:29:42.914] Game Type: MonoBleedingEdge
[20:29:42.914] Game Arch: x64
[20:29:42.914] ------------------------------
[20:29:42.914] Command-Line:
[20:29:42.914] ------------------------------
[20:29:42.914] Core::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_alternate
[20:29:42.914] Game::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_alternate
[20:29:42.918] Game::DataPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_alternate\Schedule I_Data
[20:29:42.918] Game::ApplicationPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_alternate\Schedule I.exe[20:29:42.918] Runtime Type: net35
[20:29:43.058] ------------------------------
[20:29:43.058] Game Name: Schedule I
[20:29:43.059] Game Developer: TVGS
[20:29:43.060] Unity Version: 2022.3.62f2
[20:29:43.060] Game Version: 0.4.4f10 Alternate
[20:29:43.060] ------------------------------

[20:29:43.143] Preferences Loaded!

[20:29:43.165] Loading UserLibs...
[20:29:43.166] 0 UserLibs loaded.

[20:29:43.166] Loading Plugins...
[20:29:43.176] ------------------------------
[20:29:43.178] Melon Assembly loaded: '.\Plugins\S1APILoader.MelonLoader.dll'
[20:29:43.178] SHA256 Hash: '391CB7705F235DEDE199C495EB86A21B1F319D6C45A640A1E7436680F2333628'

[20:29:43.214] ------------------------------
[20:29:43.214] S1APILoader v2.5.0
[20:29:43.214] by KaBooMa & Bars
[20:29:43.215] Assembly: S1APILoader.MelonLoader.dll
[20:29:43.215] ------------------------------
[20:29:43.215] ------------------------------
[20:29:43.215] 1 Plugin loaded.

[20:29:46.472] [S1APILoader] Loading S1API for Mono...
[20:29:46.472] [S1APILoader] Successfully loaded S1API for Mono!

[20:29:46.472] Loading Mods...
[20:29:46.473] ------------------------------
[20:29:46.478] Melon Assembly loaded: '.\Mods\S1API.Mono.MelonLoader.dll'
[20:29:46.479] SHA256 Hash: '2A12D69183796A8BB312C4B42B8F3CBD2250737062E9D04AA33B3D5DFB2C1534'

[20:29:46.484] ------------------------------
[20:29:46.484] S1API (Forked by Bars) v3.0.0
[20:29:46.484] by KaBooMa
[20:29:46.485] Assembly: S1API.Mono.MelonLoader.dll
[20:29:46.485] ------------------------------
[20:29:46.486] ------------------------------
[20:29:46.486] 1 Mod loaded.

[20:29:46.496] Support Module Loaded: C:\Program Files (x86)\Steam\steamapps\common\Schedule I_alternate\MelonLoader\Dependencies\SupportModules\Mono.dll
[20:32:19.344] [UnityExceptionTrace] [Unity] NullReferenceException
[20:32:19.344] [UnityExceptionTrace] [Unity] stack trace:
ScheduleOne.NPCs.NPCMovement+<FaceDirection_Process>d__161.MoveNext () (at <388a8b6dcfe24a37b4f7b91fd634df0b>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <c39a522eee05469b8171a6cfeb646c59>:0)
Melon Loader 0.7.2 Il2cpp
[20:27:25.231] ------------------------------
[20:27:25.232] MelonLoader v0.7.2 Open-Beta
[20:27:25.233] OS: Windows 10
[20:27:25.233] Hash Code: 09E2622405BA057EBDDA8F5A9CE473452BE7A9372274C1EA6CD43016C264C80E
[20:27:25.233] ------------------------------
[20:27:25.233] Game Type: Il2cpp
[20:27:25.234] Game Arch: x64
[20:27:25.234] ------------------------------
[20:27:25.234] Command-Line:
[20:27:25.234] ------------------------------
[20:27:25.234] Core::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public
[20:27:25.235] Game::BasePath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public
[20:27:25.238] Game::DataPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\Schedule I_Data
[20:27:25.239] Game::ApplicationPath = C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\Schedule I.exe
[20:27:25.239] Runtime Type: net6
[20:27:25.337] ------------------------------
[20:27:25.338] Game Name: Schedule I
[20:27:25.338] Game Developer: TVGS
[20:27:25.339] Unity Version: 2022.3.62f2
[20:27:25.339] Game Version: 0.4.4f10
[20:27:25.339] ------------------------------

[20:27:25.703] Preferences Loaded!

[20:27:25.712] Loading UserLibs...
[20:27:25.713] 0 UserLibs loaded.

[20:27:25.713] Loading Plugins...
[20:27:25.731] ------------------------------
[20:27:25.733] Melon Assembly loaded: '.\Plugins\S1APILoader.MelonLoader.dll'
[20:27:25.733] SHA256 Hash: '391CB7705F235DEDE199C495EB86A21B1F319D6C45A640A1E7436680F2333628'

[20:27:25.751] ------------------------------
[20:27:25.751] S1APILoader v2.5.0
[20:27:25.752] by KaBooMa & Bars
[20:27:25.752] Assembly: S1APILoader.MelonLoader.dll
[20:27:25.753] ------------------------------
[20:27:25.754] ------------------------------
[20:27:25.754] 1 Plugin loaded.

[20:27:26.467] [S1APILoader] Loading S1API for Il2Cpp...
[20:27:26.468] [S1APILoader] Successfully loaded S1API for Il2Cpp!
[20:27:26.468] Loading Il2CppAssemblyGenerator...
[20:27:26.489] [Il2CppAssemblyGenerator] Contacting RemoteAPI...
[20:27:26.610] [Il2CppAssemblyGenerator] Game Not Found on RemoteAPI Host (https://api.melonloader.com/api/v1/game/schedule-i)
[20:27:26.611] [Il2CppAssemblyGenerator] RemoteAPI.DumperVersion = null
[20:27:26.612] [Il2CppAssemblyGenerator] RemoteAPI.ObfuscationRegex = null
[20:27:26.612] [Il2CppAssemblyGenerator] RemoteAPI.MappingURL = null
[20:27:26.612] [Il2CppAssemblyGenerator] RemoteAPI.MappingFileSHA512 = null
[20:27:26.615] [Il2CppAssemblyGenerator] Using Cpp2IL Version: 2022.1.0-pre-release.21
[20:27:26.615] [Il2CppAssemblyGenerator] Using Il2CppInterop Version = 1.5.1+dbaf825aab891ff1e1627bea691bde0a81d1ad98
[20:27:26.615] [Il2CppAssemblyGenerator] Using Unity Dependencies Version = 2022.3.62
[20:27:26.616] [Il2CppAssemblyGenerator] Using Deobfuscation Regex = null
[20:27:26.616] [Il2CppAssemblyGenerator] Cpp2IL is up to date.
[20:27:26.616] [Il2CppAssemblyGenerator] Cpp2IL.Plugin.StrippedCodeRegSupport is up to date.
[20:27:26.617] [Il2CppAssemblyGenerator] UnityDependencies is up to date.
[20:27:26.617] [Il2CppAssemblyGenerator] Checking GameAssembly...
[20:27:26.703] [Il2CppAssemblyGenerator] Assembly is up to date. No Generation Needed.

[20:27:26.704] Loading Mods...
[20:27:26.724] ------------------------------
[20:27:26.733] Melon Assembly loaded: '.\Mods\S1API.Il2Cpp.MelonLoader.dll'
[20:27:26.733] SHA256 Hash: '96F5A3086589440C53FB92E5CEA3DF7BCDF087ED8BA13D57832C09BB0F4DB46A'

[20:27:26.931] ------------------------------
[20:27:26.931] S1API (Forked by Bars) v3.0.0
[20:27:26.931] by KaBooMa
[20:27:26.932] Assembly: S1API.Il2Cpp.MelonLoader.dll
[20:27:26.932] ------------------------------
[20:27:26.932] ------------------------------
[20:27:26.933] 1 Mod loaded.

[20:27:27.920] [Il2CppInterop] Class::Init signatures have been exhausted, using a substitute!
[20:27:29.411] [Il2CppInterop] Registered mono type MelonLoader.Support.MonoEnumeratorWrapper in il2cpp domain
[20:27:29.475] Support Module Loaded: C:\Program Files (x86)\Steam\steamapps\common\Schedule I_public\MelonLoader\Dependencies\SupportModules\Il2Cpp.dll
[20:27:29.484] [Il2CppInterop] Registered mono type S1API.TVApp.TVAppUpdateHandler in il2cpp domain
[20:27:29.485] [Il2CppInterop] Registered mono type S1API.PhoneApp.PhoneAppButtonHandler in il2cpp domain
[20:27:29.486] [Il2CppInterop] Registered mono type S1API.Internal.Phone.AppIconsRedirect in il2cpp domain
[20:27:29.487] [Il2CppInterop] Registered mono type S1API.Internal.Items.EquippableUseCallback in il2cpp domain
[20:27:29.495] [Il2CppInterop] Registered mono type S1API.Internal.Entities.NPCPrefabIdentity in il2cpp domain
[20:27:30.403] [Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain
[20:27:34.134] [Il2CppInterop] Registered mono type MelonLoader.Support.SM_Component in il2cpp domain
[20:28:22.335] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[20:28:22.335] [UnityExceptionTrace] [Unity] stack trace:
ScheduleOne.NPCs.NPCMovement+<FaceDirection_Process>d__161.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

[20:28:22.874] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[20:28:22.874] [UnityExceptionTrace] [Unity] stack trace:
UnityEngine.Component.GetComponentInParent (System.Type t, System.Boolean includeInactive) (at <00000000000000000000000000000000>:0)
UnityEngine.Component.GetComponentInParent[T] () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.GetReferences () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.End () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCSignal_UseATM+<<Purchase>g__Purchase|14_0>d.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

What Have You Tried?

  • Tried removing the s1api plugin/mods and the Exception did not appear.

Additional Context

Game Version: v0.4.4f10

When I just load and quit the game I also got an Exception.
The line with the FaceDirection_Process seems to be pretty consistent but other parts are not.

At some point I also got this mentioning NPCSignal_UseVendingMachine but I do not remember what I did.

Melon Loader 0.7.2 Il2cpp
[19:06:47.463] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[19:06:47.463] [UnityExceptionTrace] [Unity] stack trace:
ScheduleOne.NPCs.NPCMovement+<FaceDirection_Process>d__161.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

[19:06:47.624] [UnityExceptionTrace] [Unity] NullReferenceException: Object reference not set to an instance of an object.
[19:06:47.624] [UnityExceptionTrace] [Unity] stack trace:
UnityEngine.Component.GetComponentInParent (System.Type t, System.Boolean includeInactive) (at <00000000000000000000000000000000>:0)
UnityEngine.Component.GetComponentInParent[T] () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.GetReferences () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCAction.End () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCSignal_UseVendingMachine.CheckItem () (at <00000000000000000000000000000000>:0)
ScheduleOne.NPCs.Schedules.NPCSignal_UseVendingMachine+<<Purchase>g__Purchase|16_0>d.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)

Pre-submission Checklist

  • I have read the installation guide
  • I am using the latest version of S1API
  • I have verified this issue is related to S1API (not general modding support)
  • I am using MelonLoader 0.7.0 or have noted compatibility issues with 0.7.1+
  • I have included my MelonLoader log or relevant excerpts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions