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

Possible NPE when opening the message export dialog #3473

Closed
rbeckman-nextgen opened this issue May 11, 2020 · 6 comments
Closed

Possible NPE when opening the message export dialog #3473

rbeckman-nextgen opened this issue May 11, 2020 · 6 comments
Milestone

Comments

@rbeckman-nextgen
Copy link
Collaborator

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

It looks like several people have run into this: [http://www.mirthcorp.com/community/forums/showthread.php?t=12505]

In the setBackground method we're also setting the background on the export panel. However it appears that in some cases, setBackground may be called by the superclass' constructor, before the subclass has a chance to initialize the panel.

The exception:

Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at com.mirth.connect.client.ui.MessageExportDialog.setBackground(MessageExportDialog.java:85) at javax.swing.JDialog.dialogInit(JDialog.java:649) at javax.swing.JDialog.<init>(JDialog.java:279) at javax.swing.JDialog.<init>(JDialog.java:206) at javax.swing.JDialog.<init>(JDialog.java:179) at com.mirth.connect.client.ui.MirthDialog.<init>(MirthDialog.java:24) at com.mirth.connect.client.ui.MessageExportDialog.<init>(MessageExportDialog.java:50) at com.mirth.connect.client.ui.Frame.doExportMessages(Frame.java:3676) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) at java.beans.EventHandler.invokeInternal(EventHandler.java:482) at java.beans.EventHandler.access$000(EventHandler.java:279) at java.beans.EventHandler$1.run(EventHandler.java:430) at java.security.AccessController.doPrivileged(Native Method) at java.beans.EventHandler.invoke(EventHandler.java:428) at com.sun.proxy.$Proxy10.actionPerformed(Unknown Source) at org.jdesktop.swingx.action.BoundAction.actionPerformed(BoundAction.java:231) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at org.jdesktop.swingx.JXHyperlink.fireActionPerformed(JXHyperlink.java:264) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346) 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.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6525) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6290) at java.awt.Container.processEvent(Container.java:2234) at java.awt.Component.dispatchEventImpl(Component.java:4881) at java.awt.Container.dispatchEventImpl(Container.java:2292) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) at java.awt.Container.dispatchEventImpl(Container.java:2278) at java.awt.Window.dispatchEventImpl(Window.java:2739) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746) at java.awt.EventQueue.access$400(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.awt.EventQueue$3.run(EventQueue.java:691) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:719) at java.awt.EventQueue$4.run(EventQueue.java:717) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:716) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Imported Issue. Original Details:
Jira Issue Key: MIRTH-3578
Reporter: narupley
Created: 2015-01-20T11:20:56.000-0800

@rbeckman-nextgen rbeckman-nextgen added this to the 3.2.0 milestone May 11, 2020
@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

A null pointer exception should no longer be thrown when attempting to set the background color.

Imported Comment. Original Details:
Author: jaysenp
Created: 2015-01-22T14:34:29.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Verified that this no longer happens when using Java 8.

Imported Comment. Original Details:
Author: narupley
Created: 2015-02-09T08:25:05.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

The same issue occurs on the MessageImportDialog.

We should determine what causes it and verify if we have any other dialogs affected.

Imported Comment. Original Details:
Author: wayneh
Created: 2015-02-12T17:20:56.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Why are we overriding setBackground in this case anyways. Shouldn't setBackground on the dialog and subpanels only need to be done once and it should be done in initComponents.

Let's fix this the correct way and move all the component initializing into initComponents for both MessageExportDialog and MessageImportDialog.

Imported Comment. Original Details:
Author: wayneh
Created: 2015-02-12T17:27:57.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Organized the components and removed the overridden call to setBackground.

Imported Comment. Original Details:
Author: jaysenp
Created: 2015-02-13T11:26:48.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Was able to repro the NPEs with a previous build. The NPEs no longer occur and the dialogs appear.

Imported Comment. Original Details:
Author: leilanim
Created: 2015-02-13T14:19:44.000-0800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.