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

NullReferenceException when logging out #73

Open
mischab1 opened this issue Oct 8, 2023 · 4 comments
Open

NullReferenceException when logging out #73

mischab1 opened this issue Oct 8, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@mischab1
Copy link

mischab1 commented Oct 8, 2023

Describe the bug
A NullReferenceException shows up in the console if you log out of your world while the crosshair is pointing at a portal and showing the portal's Name and Destination

To Reproduce
Start world, look at a portal so it's Name and Destination are visible. Log out of the world

Expected behaviour
no error

LogOutput file(s)
See lines 397-401 in attached LogOutput file
(lines 12-13 in StepsTaken file)

Version
1.2.17

Environment
Steam version of Valheim via Thunderstore 1.32.2. Worlds are saved to cloud.

Other mods
BepInExPack_Valheim v5.4.2200
Jotunn v2.14.3
Official_BepInEx_ConfigurationManager v18.0.1

Priority
Low (XPortal is still working fine, error only seen in console, not otherwise noticeable.)

ex1 LogOutput.log
ex1 StepsTaken.txt
Thunderstore Mod List

@mischab1 mischab1 added the bug Something isn't working label Oct 8, 2023
@SpikeHimself
Copy link
Owner

If it's this part you're referring to:

[Info   : Unity Log] ZPlayFabMatchmaking::UnregisterServer - unregistering server now. State: Uninitialized
[Debug  :XPortal.Log] [TeleportWorld_GetHoverText.Prefix]  Shutting down, ignoring hover
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
Hud.UpdateCrosshair (Player player, System.Single bowDrawPercentage) (at <885fde5117a141d19eed8c0292c3d1fd>:0)
Hud.Update () (at <885fde5117a141d19eed8c0292c3d1fd>:0)

That error is not coming from XPortal.

@mischab1
Copy link
Author

mischab1 commented Oct 9, 2023

The error goes away if I disable XPortal but leave Jotunn & BepInEx. So my assumption was that when XPortal says it's ignoring TeleportWorld_GetHoverText.Prefix because the world is being shutdown, that XPortal's override of the portal text is returning a NullReference to Valheim's Hud.UpdateCrosshair which can't handle it.

@SpikeHimself
Copy link
Owner

That's correct, XPortal detects that the game is shutting down, and as such does not execute the GetHoverText functionality, thereby preventing it from causing such an error (that's the intention, anyway!)

Are you running any other mods at all when you do this?

@mischab1
Copy link
Author

Just BepInExPack, Jotunn, & BepInEx ConfigurationManager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants