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

[v1.2.8] Birthing Event NullReferenceException #3

Open
pbarnum opened this issue Feb 10, 2025 · 19 comments
Open

[v1.2.8] Birthing Event NullReferenceException #3

pbarnum opened this issue Feb 10, 2025 · 19 comments

Comments

@pbarnum
Copy link

pbarnum commented Feb 10, 2025

[20:41:27 ERROR screen_0 game] An error occurred in the base update loop: NullReferenceException: object reference not set to an instance of an object.
  at PolyamorySweetLove.ModEntry.BirthingEvent_tickUpdate_Prefix(GameTime time, BirthingEvent __instance, Boolean& __result, int32& ___timer, String __soundName, Boolean& __playedSound, String __message, Boolean& __naming, Boolean __getBabyName, Boolean __isMale, String __babyName) in C:\Users\Apryll\source\repos\PolyamorySweet\Pregnancy.cs:line 276
  at StardewValley.Events.BirthingEvent.tickUpdate_PatchedBy<ApryllForever.PolyamorySweetLove>(BirthingEvent this, GameTime time)
  at StardewValley.Game1._update(GameTime gameTime)
  at StardewValley.Game1.Update(GameTime gameTime)
  at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate)

(Please excuse the lack of a full SMAPI dump, I'm not at my computer and can't copy it directly)

After reviewing the code, it looks like my current version of the mod does not directly reflect what is current in master as this line referenced in the error log does not reference a nullable object. I'm unfamiliar with Stardew modding and modding in general so I don't know if there are outside processes taking place causing the line numbers to be off. However if I were to take a guess on what it could be referencing, it would be this line where I could see a reference to an NPC that happens to be null. Would it make sense to check this before accessing it's Name field?

Either way, I love the mod and hope this can be solved!

@ApryllForever
Copy link
Owner

Hi! I was not able to reproduce the bug; if you have a full log, that would help tremendously! I just pushed the latest changes.

@pbarnum
Copy link
Author

pbarnum commented Feb 10, 2025

Oh wow, first time uploading a log... That really helps!

https://smapi.io/log/007747f675e1489488c67b578f27a52e

Based on the parsed logs, I updated the "Reset Terrain Features" mod, and removed the conflicting "Custom Spouse Rooms". I'll try the day one more time and will report back with an update.

@pbarnum
Copy link
Author

pbarnum commented Feb 10, 2025

Update: We still couldn't advance to the next day. But it looks like there's more context returned based on the logs.

https://smapi.io/log/c155ddd6cd1143399f31c4cc60e6774b

@ApryllForever
Copy link
Owner

Are you in Multiplayer? Also, who is pregnant?

@pbarnum
Copy link
Author

pbarnum commented Feb 11, 2025

Yes, playing multiplayer with my wife on the same computer. My wife's character is the creator of the farm and is the one who is pregnant. She only has one husband (and 1 boyfriend) and this is the first baby.

@ApryllForever
Copy link
Owner

On the same computer as in split screen?

@pbarnum
Copy link
Author

pbarnum commented Feb 11, 2025

Yes, split screen.

@ApryllForever
Copy link
Owner

Ok! I will see if I can repeat it with the farmer pregnant then. I am lesbian but luckily I have a config for this! :)

@pbarnum
Copy link
Author

pbarnum commented Feb 11, 2025

Awesome! Thank you, and please let me know if you need anything more from me.

@ApryllForever
Copy link
Owner

Ok, tried with me pregnant, no error, means it's a multiplayer error. Wanna beta test the fix?

@pbarnum
Copy link
Author

pbarnum commented Feb 11, 2025

Yeah that sounds good. If you have a branch, I zip/install locally.

@ApryllForever
Copy link
Owner

@ApryllForever
Copy link
Owner

Here's the zip! Just slap it in in place of the old one! :)

@ApryllForever
Copy link
Owner

Plz Plz Plz work!

@ApryllForever
Copy link
Owner

Did it work?

@pbarnum
Copy link
Author

pbarnum commented Feb 12, 2025

I'm really sorry, but we haven't had a chance to get back to the game yet. If we can't get a session in tomorrow together, I'll play the day with one of the characters on idle. Only reason I haven't yet is because it happens to be a very lucky day for us during an event, and replaying it like groundhogs day is not ideal 👀.

@pbarnum
Copy link
Author

pbarnum commented Feb 12, 2025

It worked!!! The day ended and gave a correct prompt (no more "(0)" in the message). After the baby name input, it went to the summary screen and saved progress after as normal. Great job!

@pbarnum
Copy link
Author

pbarnum commented Feb 12, 2025

I don't know if this happened from your fix but we can no longer travel to the Lagoon. I'll post a log link soon.

@ApryllForever
Copy link
Owner

Lemme see what's up with the Lagoon... it works on my end, so, am quite unsure.

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

No branches or pull requests

2 participants