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

client: add null checks #647

Merged
merged 1 commit into from
Apr 27, 2024
Merged

client: add null checks #647

merged 1 commit into from
Apr 27, 2024

Conversation

po5
Copy link
Contributor

@po5 po5 commented Mar 28, 2024

This fixes some crashes.

_newPostThumbnail/_newThumbnail is a special case where we should allow null for clearing on-server custom thumbnails, but it was previously crashing anyway because of a deeper rooted issue.
That's addressed in #646. In this PR the initial state just does nothing instead of crashing.

@neobooru
Copy link
Collaborator

neobooru commented Apr 3, 2024

Is there any specific reason why you chose to take x !== undefined && x !== null over something like x != undefined? I get that it is technically more correct, but does it matter in real life?
Oh and thanks for all the PR's. It'll take me a while before I can get through them all, but thanks nonetheless.

@po5
Copy link
Contributor Author

po5 commented Apr 3, 2024

Wow I did not realize null == undefined and nothing else. I guess it would work, though in a few places we do want to allow null and it's easier to tell those cases apart this way.
Will probably have another round of PRs after some are merged/closed, don't want it to be a conflict hell since some changes will depend on existing PRs.

@neobooru neobooru merged commit d102578 into rr-:master Apr 27, 2024
1 check passed
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