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

Empty post bodies #2050

Merged
merged 5 commits into from
Jan 21, 2022
Merged

Empty post bodies #2050

merged 5 commits into from
Jan 21, 2022

Conversation

dessalines
Copy link
Member

I did the last one wrong. text.map can't return a none inside if the trim is empty.

@dessalines dessalines requested a review from Nutomic January 20, 2022 14:42
@Nutomic
Copy link
Member

Nutomic commented Jan 20, 2022

Whoops i also missed that. But you can still get rid of the outer if using map, and just keep the inner if.

@dessalines
Copy link
Member Author

I don't think that's possible, because you can't return None inside a map like that.

@Nutomic
Copy link
Member

Nutomic commented Jan 20, 2022

Right. You could try with .filter() or something like that.

@dessalines
Copy link
Member Author

That's not necessary, this works as is.

@Nutomic Nutomic merged commit 16271b0 into main Jan 21, 2022
@Nutomic
Copy link
Member

Nutomic commented Jan 21, 2022

True.

dessalines added a commit that referenced this pull request Jan 27, 2022
* Cleaning optional post bodies. Fixes #2039

* Only trim once.

* Using .map() instead.

* Revert "Using .map() instead."

This reverts commit a2f4907.
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