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

Simplify the SRAM's representation in NDSCartArgs #1914

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

JesseTG
Copy link
Contributor

@JesseTG JesseTG commented Dec 13, 2023

When all you have is a hammer, everything looks like a nail...

I overthought this one. I could've just checked args && args->SRAM, but then some other poor bastard might make this mistake. Don't mix pair, optional, and unique_ptr all at once, kids.

This PR resolves a crash in melonDS DS that occurs when loading a game without any available save data. It doesn't occur in upstream melonDS because it uses a different constructor overload than I do.

- I overthought this one.
- I could've just checked `args && args->SRAM`, but then some other poor bastard might make this mistake.
- Don't mix `pair`, `optional`, and `unique_ptr` all at once, kids.
@RSDuck RSDuck merged commit e1821d0 into melonDS-emu:master Dec 15, 2023
4 of 5 checks passed
kvnp pushed a commit to kvnp/melonDS that referenced this pull request Dec 25, 2023
* Simplify the SRAM's representation in  `NDSCartArgs`

- I overthought this one.
- I could've just checked `args && args->SRAM`, but then some other poor bastard might make this mistake.
- Don't mix `pair`, `optional`, and `unique_ptr` all at once, kids.

* Fix a `nullptr` read
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

Successfully merging this pull request may close these issues.

2 participants