-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix: Handled NullPointerException when importing old JabRef preferences (#14497) #14507
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey @subhash-dev-23! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. Please re-check our AI Usage Policy to ensure that your pull request is in line with it. It also contains links to our contribution guide in case of any other doubts related to our contribution workflow. |
CHANGELOG.md
Outdated
|
|
||
| ### Fixed | ||
|
|
||
| - We fixed an issue where a NullPointerException was thrown when userAndHost was not initialized in the preferences. The initialization now correctly falls back to getUserHostInfo() to prevent the error. [#14497](https://github.com/JabRef/jabref/issues/14497) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second sentence is an implementation detail. Maybe also shorten the first sentence, because NPE is unknown to the users. Think of a non-programmer using JabRef.
|
You committed your code on the For this pull request, this is OK. For subsequent pull requests, please start with a different branch with a proper branch name. See CONTRIBUTING.md for more details. |
|
While the PR was in progress, a new version of JabRef has been released. You have to merge |
|
|
||
| ## [Unreleased] | ||
|
|
||
| - Fixed a problem where JabRef could crash during startup if certain preference data was missing. [#14497](https://github.com/JabRef/jabref/issues/14497) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

…es (#14497)
Closes #14497
This PR fixes a NullPointerException that occurred when userAndHost was null during the initialization of InternalPreferences.
The fix ensures that the existing getUserHostInfo() method is used to safely initialize userAndHost, avoiding direct access to an uninitialized value.
Steps to test
Launch JabRef in an environment where no userAndHost value has been initialized yet.
Verify that JabRef starts without throwing a NullPointerException.
Confirm that preference migrations complete successfully.
Check the log to ensure no warnings or errors related to UserHostInfo initialization appear.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)