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

2807: Removing EquipmentParts whose EquipmentTypes fail to parse #2808

Merged
merged 1 commit into from
Aug 22, 2021

Conversation

Windchild292
Copy link
Contributor

This (I believe... it works, but I'm not sure about unexpected behaviour) fixed #2807.

@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #2808 (eca2c9d) into master (b369626) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2808      +/-   ##
============================================
- Coverage     10.61%   10.61%   -0.01%     
+ Complexity     3870     3868       -2     
============================================
  Files           717      717              
  Lines        100142   100145       +3     
  Branches      16414    16415       +1     
============================================
- Hits          10635    10634       -1     
- Misses        88118    88122       +4     
  Partials       1389     1389              
Impacted Files Coverage Δ
MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/campaign/mission/AtBContract.java 18.92% <0.00%> (-0.30%) ⬇️
...ekHQ/src/mekhq/campaign/market/ContractMarket.java 57.94% <0.00%> (-0.21%) ⬇️
MekHQ/src/mekhq/campaign/universe/Systems.java 42.23% <0.00%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a02299e...eca2c9d. Read the comment docs.

final EquipmentPart ePart = (EquipmentPart) prt;

// Null Type... parsing failure
if (ePart.getType() == null) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's log something about this if it happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at it when doing this. There's not enough data to make a useful log... and the useful data is previously logged.

Copy link
Contributor

Choose a reason for hiding this comment

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

May need to move the check/log earlier in the call stack to catch the part type that was bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already log it when we fail to restore the equipment type. Just found it can be null at this point and... it's better to remove than deal with it down the line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that good @NickAragua? Would like this done for 0.49.3 if possible

Copy link
Member

Choose a reason for hiding this comment

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

Might as well. Not like that piece of equipment is recoverable anyway.

@Windchild292 Windchild292 merged commit 81f301a into MegaMek:master Aug 22, 2021
@Windchild292 Windchild292 deleted the dev_Windchild_2807 branch August 22, 2021 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.47.1 -> 0.48.0 or 0.49.2] Import of MekHQ Campaign file fails
3 participants