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

Reordered Asset Removal and Event Trigger in ManageAssetsDialog #4444

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Jul 20, 2024

The asset removal event was being called after the asset had been removed, resulting in an out-of-index error. This PR just re-orders them so that the object still exists at the called index when the event occurs, it is then removed once processing has been completed.

Closes #4437

The sequence of actions in the deleteAsset() method of ManageAssetsDialog was rearranged. The AssetRemovedEvent is now triggered before the actual asset removal from the assets list to ensure proper event handling.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.24%. Comparing base (77d2e66) to head (f80a68f).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4444   +/-   ##
=========================================
  Coverage     10.24%   10.24%           
  Complexity     5809     5809           
=========================================
  Files           924      924           
  Lines        126439   126439           
  Branches      18767    18768    +1     
=========================================
  Hits          12953    12953           
  Misses       112211   112211           
  Partials       1275     1275           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@IllianiCBT IllianiCBT merged commit da2d208 into MegaMek:master Jul 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NPE] Null pointer exception while removing an asset
3 participants