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

Potential NPE in GsonEObjectDeserializer#resolveType #50

Open
AxelRICHARD opened this issue Sep 25, 2024 · 0 comments · May be fixed by #51
Open

Potential NPE in GsonEObjectDeserializer#resolveType #50

AxelRICHARD opened this issue Sep 25, 2024 · 0 comments · May be fixed by #51
Assignees

Comments

@AxelRICHARD
Copy link

In https://github.com/eclipse-sirius/sirius-emf-json/blob/master/bundles/org.eclipse.sirius.emfjson/src/main/java/org/eclipse/sirius/emfjson/utils/GsonEObjectDeserializer.java#L619, this.resourceSet.getPackageRegistry() is called without check on this.resourceSet, which can raise NPE.
Furthermore, in https://github.com/eclipse-sirius/sirius-emf-json/blob/master/bundles/org.eclipse.sirius.emfjson/src/main/java/org/eclipse/sirius/emfjson/utils/GsonEObjectDeserializer.java#L174, a variable this.packageRegistry already contains the appropriate value.

So, it seems that this.resourceSet.getPackageRegistry() should be replaced by this.packageRegistry in GsonEObjectDeserializer

@AxelRICHARD AxelRICHARD added bug Something isn't working and removed bug Something isn't working labels Sep 25, 2024
@AxelRICHARD AxelRICHARD self-assigned this Sep 25, 2024
AxelRICHARD added a commit that referenced this issue Sep 26, 2024
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 a pull request may close this issue.

1 participant