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

Issue 3254 protobuf null pointer exceptions #3353

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Jan 25, 2022

Identify the Bug or Feature request

Improves #3254

Description of the Change

There are several model types that have fields that aren't expected to be null but which can be made null as a result of deserialization. This made it impossible to open many campaign files, possibly also affecting other actions that require deserialization. This changes primarly adds or modifies readResolve() methods for various model types to avoid undesirable nulls.

A couple smaller fixes are also included:

  • Infinite recursion for parameterless token updates.
  • Fix for tokens marked Visible to players also becoming Visible over FoW when a server is started.
  • Handle null exposed area GUIDs by ignoring them while serializing.

Possible Drawbacks

Shouldn't be any drawbacks in behaviour. There may be a better way to handle deserialization with missing / null fields that could avoid some of these checks.

Skipping the null keys for Zone.exposedAreaMeta is kind of the wildcard in this change. Those keys shouldn't be possible and yet they exist, so maybe there could be some edge case where they can be read back out again.

Documentation Notes

N/A

Release Notes

N/A


This change is Reviewable

Copy link
Contributor

@Phergus Phergus left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kwvanderlinde)

@kwvanderlinde
Copy link
Collaborator Author

Fixed the formatting - sorry about that.

Copy link
Contributor

@Phergus Phergus left a comment

Choose a reason for hiding this comment

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

We've all done it. :lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kwvanderlinde)

@Phergus Phergus merged commit c7059bd into RPTools:develop Jan 25, 2022
@kwvanderlinde kwvanderlinde deleted the issue-3254-protobuf-null-pointer-exceptions branch January 25, 2022 22:30
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