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

Service context null pointer #7593

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

wangf1122
Copy link
Collaborator

Based on this PR #7556 there seems to be some bug in cmisStore where the ServiceContext was passed as null object.

The issue is not reproduceable in the 4.0 main branch due to the mechanism difference. But it's reproduceable in the 3.12 backport commit ianwallen@91795de

The null pointer avoidance is needed in order to make it work

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • [] Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • [] API Changes are identified in commit messages
  • [] Testing provided for features or enhancements using automatic tests)
  • User documentation provided for new features or enhancements in mannual
  • [] Build documentation provided for development instructions in README.md files
  • [] Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

wangf1122 referenced this pull request in ianwallen/core-geonetwork Jan 3, 2024
…ed in GeoNetwork and requires authentication to access it. Fixes geonetwork#7540 (geonetwork#7556)
@ianwallen
Copy link
Contributor

@wangf1122

The following also use the same context code. So they will probably have the same issue. So they should be fixed as well.

/datastorages/jcloud/src/main/java/org/fao/geonet/api/records/attachments/JCloudStore.java
/datastorages/jcloud/src/main/java/org/fao/geonet/api/records/attachments/S3.java

@wangf1122
Copy link
Collaborator Author

@wangf1122

The following also use the same context code. So they will probably have the same issue. So they should be fixed as well.

/datastorages/jcloud/src/main/java/org/fao/geonet/api/records/attachments/JCloudStore.java /datastorages/jcloud/src/main/java/org/fao/geonet/api/records/attachments/S3.java

I fixed most of them. But here is some leftover which I am not capable to figure out

https://github.com/geonetwork/core-geonetwork/blob/523a8c7f07889ccc043ba4d1c57e5106d228e3e9/core/src/main/java/org/fao/geonet/kernel/AccessManager.java#L131C50-L131C50

UserSession us = context.getUserSession();

They are about context.getUserSession(); but context here is null. I am sure it will cause null pointer

@ianwallen ianwallen merged commit 63cd59f into geonetwork:main Jan 10, 2024
6 checks passed
@ianwallen ianwallen added this to the 4.4.2 milestone Jan 10, 2024
ianwallen pushed a commit that referenced this pull request Jan 10, 2024
* Service context null pointer

* Service context null pointer for JCloud and S3
ianwallen pushed a commit that referenced this pull request Jan 10, 2024
* Service context null pointer

* Service context null pointer for JCloud and S3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants