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

Fix: Moving the last page item to the the trash causes a crash. #65236

Conversation

jorgefilipecosta
Copy link
Member

Fixes an issue found by @jasmussen, where when there is only a single page available on the all-pages view. Moving the page to the trash crashes the application.

Testing Instructions

Go to the site editor -> pages.
On the all pages view move all the pages to the trash so there is only a single page left.
Now move that single page to the trash and verify everything worked well on trunk a crash happens.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Sep 11, 2024
Copy link

github-actions bot commented Sep 11, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jasmussen
Copy link
Contributor

Nice, thanks for working on this.

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @jorgefilipecosta!

The fix works as expected, and it makes sense to add this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants