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

Fix some small issues on dataset view #1935

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

youennmerel
Copy link
Collaborator

@youennmerel youennmerel commented Oct 30, 2023

@jcomedouteau
Copy link
Collaborator

jcomedouteau commented Oct 31, 2023

Alors, j'ai un petit soucis, qui n'a rien a voir avec ce que tu as fait, mais c'est peut-être l'occasion de le corriger..
Pour une bonne partie des datasets "anciens", le originmetadataId est null.
Du coup on se paye cette exception:

2023-10-31T15:00:58.931+01:00 ERROR 1 --- [http-nio-9904-exec-6] o.s.n.s.c.GlobalExceptionHandler : Unexpected error in the rest service.

java.lang.NullPointerException: Cannot invoke "java.lang.Long.equals(Object)" because the return value of "org.shanoir.ng.dataset.model.DatasetMetadata.getId()" is null
at org.shanoir.ng.dataset.service.DatasetServiceImpl.updateDatasetValues(DatasetServiceImpl.java:188)
at org.shanoir.ng.dataset.service.DatasetServiceImpl.update(DatasetServiceImpl.java:169)

Faut qu'on en discute, mais je pense qu'on peut forcer pour ces datasets le originMetadata à updatated metadata.
Edit: Enfait il faut juste inverser la condition dans DatasetServiceImpl l.188:
if (dataset.getUpdatedMetadata().getId().equals(dataset.getOriginMetadata().getId())) {

Comme ça si originMetadata est null, ca retourne faux et on continue tranquille.
J'ai vérifié, le updatedMetadata est jamais null en BDD.

@youennmerel
Copy link
Collaborator Author

youennmerel commented Nov 9, 2023

En fait il faut juste inverser la condition dans DatasetServiceImpl l.188:
if (dataset.getUpdatedMetadata().getId().equals(dataset.getOriginMetadata().getId())) {
Comme ça si originMetadata est null, ca retourne faux et on continue tranquille.
J'ai vérifié, le updatedMetadata est jamais null en BDD.

@jcomedouteau Done !

Copy link
Collaborator

@jcomedouteau jcomedouteau left a comment

Choose a reason for hiding this comment

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

Ok, tested with "old dataset" without originMetadata

@jcomedouteau jcomedouteau merged commit dbcc230 into fli-iam:develop Nov 13, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REVIEWABLE Has to be reviewed
Projects
None yet
2 participants