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

Change case of an empty field throws an exception #9214

Closed
2 tasks done
mlep opened this issue Oct 4, 2022 · 1 comment · Fixed by #9215
Closed
2 tasks done

Change case of an empty field throws an exception #9214

mlep opened this issue Oct 4, 2022 · 1 comment · Fixed by #9215
Labels
bug Confirmed bugs or reports that are very likely to be bugs

Comments

@mlep
Copy link
Contributor

mlep commented Oct 4, 2022

JabRef version

Latest development branch build (please note build date below)

Operating system

GNU / Linux

Details on version and operating system

JabRef 5.8--2022-10-03--e48ed0c Linux 5.10.0-18-amd64 amd64 Java 18.0.2.1 JavaFX 19+11

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

The issue is similar to #9200
(@TheGor1lla: interested?)

  1. Select an entry by double-clicking.
  2. Right-click on an empty field from the entry editor.
  3. Select Change case > (any of the item).
    An exception is raised.

No exception should be raised.
Menu could be made unavailable for empty strings.

Appendix

...

Log File

Uncaught exception occurred in Thread[JavaFX Application Thread,5,main]
java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null
at org.jabref@5.8.131/org.jabref.logic.formatter.casechanger.TitleParser.determineProtectedChars(Unknown Source)
at org.jabref@5.8.131/org.jabref.logic.formatter.casechanger.TitleParser.parse(Unknown Source)
at org.jabref@5.8.131/org.jabref.logic.formatter.casechanger.Title.(Unknown Source)
at org.jabref@5.8.131/org.jabref.logic.formatter.casechanger.CapitalizeFormatter.format(Unknown Source)
at org.jabref@5.8.131/org.jabref.gui.fieldeditors.contextmenu.DefaultMenu.lambda$getCaseChangeMenu$0(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.event.Event.fireEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.scene.control.MenuItem.fire(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createNodeMenuItemChildren$14(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.event.Event.fireEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.scene.Scene$ClickGenerator.postProcess(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.scene.Scene$MouseHandler.process(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.scene.Scene.processMouseEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.glass.ui.View.notifyMouse(Unknown Source)
at org.jabref.merged.module@5.8.131/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at org.jabref.merged.module@5.8.131/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Oct 4, 2022
@TheGor1lla
Copy link
Contributor

Handling it the same as the conversion menu sounds good to. I'll propose a change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants