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

Convert an empty field from Latex to Unicode throws an exception #9200

Closed
2 tasks done
HoussemNasri opened this issue Oct 1, 2022 · 1 comment · Fixed by #9202
Closed
2 tasks done

Convert an empty field from Latex to Unicode throws an exception #9200

HoussemNasri opened this issue Oct 1, 2022 · 1 comment · Fixed by #9202
Labels
entry-editor good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@HoussemNasri
Copy link
Member

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

No response

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

  1. Select an entry by double-clicking.
  2. Right-click on an empty field from the entry editor.
  3. Select Convert then LaTeX to Unicode.

An exception is also raised when using the other conversion options (HTML to LaTeX...).

Appendix

Log File
java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at [email protected]/org.jabref.model.strings.LatexToUnicodeAdapter.format(LatexToUnicodeAdapter.java:29)
	at [email protected]/org.jabref.logic.layout.format.LatexToUnicodeFormatter.format(LatexToUnicodeFormatter.java:26)
	at [email protected]/org.jabref.gui.fieldeditors.contextmenu.DefaultMenu.lambda$getConversionMenu$1(DefaultMenu.java:66)
	at javafx.base@19/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at javafx.base@19/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at javafx.base@19/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@19/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.base@19/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.controls@19/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at javafx.controls@19/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createNodeMenuItemChildren$14(ContextMenuContent.java:1407)
	at javafx.base@19/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at javafx.base@19/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base@19/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at javafx.base@19/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at javafx.base@19/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@19/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@19/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@19/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base@19/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@19/javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3599)
	at javafx.graphics@19/javafx.scene.Scene$MouseHandler.process(Scene.java:3903)
	at javafx.graphics@19/javafx.scene.Scene.processMouseEvent(Scene.java:1887)
	at javafx.graphics@19/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2620)
	at javafx.graphics@19/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at javafx.graphics@19/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@19/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at javafx.graphics@19/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@19/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at javafx.graphics@19/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at javafx.graphics@19/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at javafx.graphics@19/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@19/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
	at java.base/java.lang.Thread.run(Thread.java:833)

@HoussemNasri HoussemNasri added good first issue An issue intended for project-newcomers. Varies in difficulty. entry-editor labels Oct 1, 2022
@TheGor1lla
Copy link
Contributor

Had a quick look at the code, what would be the desired outcome of the format operation?

Personally I'd return an empty String instead. Would that be okay, if so I can do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entry-editor good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants