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

Don't throw exception when validating invalid paths #8112

Merged
merged 4 commits into from
Oct 4, 2021
Merged

Don't throw exception when validating invalid paths #8112

merged 4 commits into from
Oct 4, 2021

Conversation

berry120
Copy link
Contributor

@berry120 berry120 commented Oct 1, 2021

Fixes #8107

While usually I don't advocate silently catching exceptions, in this case I think it's the right thing to do as we just want a true / false value as to whether the path is valid or not. If we catch an InvalidPathException then we always know that the path is invalid - so this fixes the attached issue with UNC paths, as well as any other theoretical invalid path that might throw this exception.

  • 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 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
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

thanks for your contribution, I guess this is fine in this case!

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 2, 2021
@calixtus
Copy link
Member

calixtus commented Oct 4, 2021

Looks good to me. Thanks. Merging now!

@calixtus calixtus merged commit bac8304 into JabRef:main Oct 4, 2021
Siedlerchr added a commit that referenced this pull request Oct 4, 2021
* upstream/main:
  Don't throw exception when validating invalid paths (#8112)
  Bump jackson-dataformat-yaml from 2.12.5 to 2.13.0
  Bump jackson-datatype-jsr310 from 2.12.5 to 2.13.0
  Bump byte-buddy-parent from 1.11.15 to 1.11.18
  Bump classgraph from 4.8.116 to 4.8.121
  Bump checkstyle from 9.0 to 9.0.1
  remove iso charset, website returns utf8 for icar comp sci only returns one result
  fix springer fetcher Fix computer science fetcher
  Squashed 'buildres/csl/csl-locales/' changes from 7a507fc008..495f888637
  Squashed 'buildres/csl/csl-styles/' changes from 5facb37..3b00357
  Update CHANGELOG.md
  snap: Use lzo compression & switch to core20 base
Siedlerchr added a commit that referenced this pull request Oct 10, 2021
* upstream/main: (149 commits)
  Add Tutorials for javafx
  lint
  Add changelot
  Open folder on mac and highlight file
  Add Tests to DoiCleanup (#8124)
  Improve Drag and Drop in Custom Entry types dialog (#8121)
  Show preview also for available styles (#8110)
  udpate to javafx 17.0.0.1
  Don't throw exception when validating invalid paths (#8112)
  Bump jackson-dataformat-yaml from 2.12.5 to 2.13.0
  Bump jackson-datatype-jsr310 from 2.12.5 to 2.13.0
  Bump byte-buddy-parent from 1.11.15 to 1.11.18
  Bump classgraph from 4.8.116 to 4.8.121
  Bump checkstyle from 9.0 to 9.0.1
  remove iso charset, website returns utf8 for icar comp sci only returns one result
  fix springer fetcher Fix computer science fetcher
  Squashed 'buildres/csl/csl-locales/' changes from 7a507fc008..495f888637
  Squashed 'buildres/csl/csl-styles/' changes from 5facb37..3b00357
  Update CHANGELOG.md
  snap: Use lzo compression & switch to core20 base
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing an UNC path into "Linked files" -> "Main file directory" should trigger validation at field exit
3 participants