sghpjuikit / player

Audio player and management application.
22 stars 2 forks source link

Exception on Examine In > Inspector #116

Closed xeruf closed 5 years ago

xeruf commented 5 years ago
58:47.046 E [JavaFX Applicat] CoreLogging - Uncaught exception
java.lang.IllegalStateException: o.image must not be null
        at sp.it.pl.gui.objects.tree.TreeItemsKt.tree(TreeItems.kt:92)
        at inspector.Inspector.open(Inspector.kt:154)
        at sp.it.pl.core.CoreMenus$init$$inlined$apply$lambda$1$2$1$1.invoke(CoreMenus.kt:236)
        at sp.it.pl.core.CoreMenus$init$$inlined$apply$lambda$1$2$1$1.invoke(CoreMenus.kt:43)
        at sp.it.pl.layout.widget.WidgetManager$FactoryRef.use(WidgetManager.kt:605)
        at sp.it.pl.layout.widget.WidgetManager$FactoryRef.use$default(WidgetManager.kt:603)
        at sp.it.pl.core.CoreMenus$init$$inlined$apply$lambda$1$2$1.invoke(CoreMenus.kt:221)
        at sp.it.pl.core.CoreMenus$init$$inlined$apply$lambda$1$2$1.invoke(CoreMenus.kt:43)
        at sp.it.pl.core.CoreMenus$items$1$1.handle(CoreMenus.kt:214)
        at sp.it.pl.core.CoreMenus$items$1$1.handle(CoreMenus.kt:43)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at javafx.controls/javafx.scene.control.MenuItem.fire(MenuItem.java:465)
        at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1380)
        at javafx.controls/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1333)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3876)
        at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604)
        at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
        at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
        at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
        at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
        at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
        at java.base/java.lang.Thread.run(Thread.java:844)
sghpjuikit commented 5 years ago

I reproduced the issue. Closing as fixed.

Notes:

Nullability issue caused by the Kotlin-Java interop. I have found some more related to Image in the TreeItems.kt.

Unfortunately this is tricky as Inspector is not ready to have TreeView<Any?> because tree(o: Any) signature. I provided a simple and almost ideal workaround using function:

private fun Any?.orNone(): Any = this ?: "<none>"

xeruf commented 5 years ago

Why are you closing as fixed? You should use the "Fix" syntax in the commit and then push that commit to close it. Or do you have it fixed locally and not pushed? An issue should usually only be closed once the fix is on master.

sghpjuikit commented 5 years ago

Indeed I have it fixed locally. You are right and I'm sorry. I was working on bugs and just kept delaying the push... my bad.

xeruf commented 5 years ago

I know that feeling ^^ but more commits should almost always be better, and putting the fix to an issue in a separate commit should be preferred, then you can also simply instantly push and stash or commit the other stuff first if you want.

xeruf commented 5 years ago

Oh I see you already did it in many small commits, but you just didn't push them ^^

sghpjuikit commented 5 years ago

Exactly. I just prefer to push in chunks... Particularly when im burning through the bugs. Also, it allows me to leave the commits in an incubation phase and fix problems before they make it to remote.