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 NPE when tab is close during load #10841

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Fix NPE when tab is close during load #10841

merged 1 commit into from
Jan 30, 2024

Conversation

koppor
Copy link
Member

@koppor koppor commented Jan 29, 2024

When a large library is loaded and the tab is close during load, there is an exception:

java.lang.NullPointerException: Cannot invoke "javafx.scene.control.TabPane.getSelectionModel()" because the return value of "org.jabref.gui.LibraryTab.getTabPane()" is null
	at org.jabref@100.0.0/org.jabref.gui.LibraryTab.setDatabaseContext(LibraryTab.java:264)
	at org.jabref@100.0.0/org.jabref.gui.LibraryTab.onDatabaseLoadingSucceed(LibraryTab.java:243)

This PR fixes that - and also adds some NPE checks at close (to enable the tab being closed despite NPEs)

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Copy link
Contributor

github-actions bot commented Jan 29, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@calixtus calixtus added this pull request to the merge queue Jan 30, 2024
Merged via the queue into main with commit 6e5f3c5 Jan 30, 2024
18 checks passed
@calixtus calixtus deleted the fix-close-during-load branch January 30, 2024 16:19
Siedlerchr added a commit that referenced this pull request Feb 3, 2024
* upstream/main:
  Fix NPE when tab is close during load (#10841)
  Bump peter-evans/create-or-update-comment from 3 to 4 (#10838)
  Bump styfle/cancel-workflow-action from 0.12.0 to 0.12.1 (#10835)
  Bump lycheeverse/lychee-action from 1.9.1 to 1.9.3 (#10837)
  Bump gradle/gradle-build-action from 2 to 3 (#10836)
  Bump com.puppycrawl.tools:checkstyle from 10.12.7 to 10.13.0 (#10830)
  Bump org.mockito:mockito-core from 5.9.0 to 5.10.0 (#10834)
  Bump org.openrewrite.rewrite from 6.7.0 to 6.8.1 (#10833)
  Bump org.openrewrite.recipe:rewrite-recipe-bom from 2.6.2 to 2.6.3 (#10832)
  Apply RemoveTestPrefix (#10823)
  Update to jdk 21.0.2 (#10827)
  Fix escaping of slashes for TexShop (#10826)
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 this pull request may close these issues.

3 participants