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

Catch NPE when unknown metadata and metadata groups are created during import #5399

Closed
wants to merge 1 commit into from

Conversation

solth
Copy link
Member

@solth solth commented Oct 14, 2022

This PR catches the NullPointerException that can occur during import that is decribed in #5217 and shows a corresponding error message. It does not fix the underlying issue, but just mitigates the problem.

@solth solth added the bug label Oct 14, 2022
@solth solth requested a review from markusweigelt October 17, 2022 06:32
return new ProcessFieldedMetadata(structure, divisionView);
try {
return new ProcessFieldedMetadata(structure, divisionView);
} catch (NullPointerException e) {
Copy link
Collaborator

@markusweigelt markusweigelt Oct 17, 2022

Choose a reason for hiding this comment

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

I think when we catch NPE than we should be more direct on the problem e.g. in function ProcessFieldedMetadata.createMetadataEntryEdit. This function should throw ProcessException or a new ProcessFieldException. Otherwise it leads to confusion, misinterpretation or hides other problems.

@solth
Copy link
Member Author

solth commented Oct 17, 2022

As it turns out, handling for the null pointer exception mentioned in #5217 is already covered by the changes in #5390, so this pr can be closed.

@solth solth closed this Oct 17, 2022
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.

2 participants