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

CompatibleProfile: return null or dummy profile for missing profiles? also: standardize clearing behavior #55

Open
crashdemons opened this issue Feb 2, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@crashdemons
Copy link
Owner

ref #52

new issue to indicate the lower priority nature of this

@crashdemons crashdemons added the enhancement New feature or request label Feb 2, 2021
@crashdemons crashdemons added this to the far-future-version milestone Feb 2, 2021
@crashdemons
Copy link
Owner Author

crashdemons commented Feb 2, 2021

to ease this though, there are new methods in 5.2.14:
CompatibleProfile:hasRequiredFields() which checks if id and/or name are set.
CompatibleProfile.isValid( profile ) which combines that check with a null check

using these in the future may simplify a lot of code. although return null for a lack of profile is still preferable to a null profile.
The dummy profile serves almost the same purpose as a null profile though in that both are for the same case (no profile present)

However, consider:

  • setting an empty or null profile to "clear" existing profile from a skull may be unwanted
  • having a standard way to clear a profile from a skull may be wanted though
  • currently, setting a null compatibleprofile will cause an NPE (it tries to get the internal object first)
  • currently, setting a dummy profile will cause an IAE (creating a GameProfile with null id, null name)

It will be important to define and standardize which ways can and can't be used for setting/clearing going forward.

@crashdemons crashdemons changed the title have CompatibilityProviders check for null instead of giving them a dummy profile? CompatibleProfile: return null or dummy profile for missing profiles? also: standardize clearing behavior Feb 2, 2021
@crashdemons
Copy link
Owner Author

5.2.14-SNAPSHOT will standardize a clearing method, but the question remains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant