Hello,
Trying to clear the description under Set annotation properties results in the following NPE.
Show log
INFO: Initializing type adapters
INFO: Bio-Formats version 6.5.1
INFO: Loaded extension Bio-Formats options (Bio-Formats 6.5.1) (20 ms)
INFO: Loaded extension Experimental extension (1 ms)
INFO: Loaded extension ImageJ extension (65 ms)
INFO: Loaded extension JPen extension (17 ms)
INFO: Loaded extension Processing extension (31 ms)
INFO: Loaded extension Rich script editor extension (509 ms)
INFO: Loaded extension SVG export extension (2 ms)
INFO: OpenSlide version 3.4.1
INFO: Starting QuPath with parameters: []
INFO: Project set to Project: debug-project
INFO: Image data set to ImageData: Not set, Mirax2-Fluorescence-1.tif
ERROR: QuPath exception
at qupath.lib.objects.PathAnnotationObject.setDescription(PathAnnotationObject.java:75)
at qupath.lib.gui.tools.GuiTools.promptToSetAnnotationProperties(GuiTools.java:795)
at qupath.lib.gui.tools.GuiTools.promptToSetActiveAnnotationProperties(GuiTools.java:712)
at qupath.lib.gui.tools.GuiTools.lambda$createAnnotationsMenuImpl$12(GuiTools.java:839)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.control.MenuItem.fire(MenuItem.java:459)
at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1380)
at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1333)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3890)
at javafx.scene.Scene.processMouseEvent(Scene.java:1885)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2618)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
at com.sun.glass.ui.View.notifyMouse(View.java:942)
at com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)
Steps to reproduce on QuPath-0.2.3 (although I think it still occurs on the dev-0.3 branch):
- Open an (arbitrary) image
- Draw an annotation
- Right-click the annotation and select Set properties
- Set description text (any character length) and click OK
- Finally, try to clear description text and click OK
The description is not cleared on macOS Big Sur (or Windows 10).
Here is a (oversimplified) hotfix which removes the isEmpty() check (can redo against main):
This appears to resolve the issue on the surface, but I’m concerned if/how this affects the metadata now knowing:
Thanks!