openlcb / OpenLCB_Java

A git-managed copy of the SVN-based Java prototype implementation of OpenLCB. This implementation operates inside JMRI.
6 stars 9 forks source link

LoaderClient throws NPE when user presses cancel on file selection #91

Closed balazsracz closed 1 year ago

balazsracz commented 7 years ago

Steps to repro:

expected result: nothing happens actual result: NPE gets printed to the console.

This is what it looks like: 2017-04-25 16:04:49,340 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [AWT-EventQueue-0] java.lang.NullPointerException at jmri.jmrix.openlcb.swing.downloader.LoaderPane.doRead(LoaderPane.java:95) at jmri.jmrix.AbstractLoaderPane.lambda$0(AbstractLoaderPane.java:111) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280)

It seems we don't check for the return status when getting back control from the file select dialog.

bobjacobsen commented 1 year ago

This was fixed in JMRI 5.3.4 by JMRI/JMRI/#111811, please close.