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: Fixed issue were removing a tag after changing the layout would cause a crash #12839

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

ferrariofilippo
Copy link
Contributor

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Bug: Deleting tags after changing layout may cause crash #12814

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Set "Home" tag and "Work" tag to a folder in the details layout.
    2. Change the layout to the grid layout.
    3. Change the layout back to the details layout.
    4. Delete "Home" tag.
    5. Delete "Work" tag.
    6. The app will crash.

Screenshots (optional)
A part of the issue is caused by Select throwing exception with empty arrays, the other is related to this piece of code
Screenshot 2023-07-03 221547
Since FileTagsUI is empty [0] doesn't exist. I fixed setting it to null, but we could also create a FirstTag property

@yaira2 yaira2 changed the title Fix: Deleting tags after changing layout may cause crash Fix: Fixed issue were removing a tag after changing the layout would cause a crash Jul 3, 2023
Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Jul 3, 2023
@yaira2 yaira2 merged commit f451451 into files-community:main Jul 3, 2023
@ferrariofilippo ferrariofilippo deleted the Fix_Tags_Deletion branch July 3, 2023 22:20
@hishitetsu
Copy link
Member

Certainly this avoids crashes, but the underlying problem is that the binding to the grid layout occurs despite the change to the details layout. This may cause other problems besides this crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Deleting tags after changing layout may cause crash
3 participants