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

NPE when closing MapTool after a macro is opened twice simultaneously for editing. #1426

Closed
Merudo opened this issue Mar 28, 2020 · 5 comments
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@Merudo
Copy link
Member

Merudo commented Mar 28, 2020

Describe the bug
I've noticed an occasional NPE in the console when closing MapTool. When not using the console, I see a window popup for a split second while closing, exactly how it was for #700.

java.lang.NullPointerException: null
        at net.rptools.maptool.client.ui.MacroButtonDialog.updateOpenMacroList(MacroButtonDialog.java:299) ~[main/:?]
        at net.rptools.maptool.client.ui.MacroButtonDialog.access$100(MacroButtonDialog.java:84) ~[main/:?]
        at net.rptools.maptool.client.ui.MacroButtonDialog$1.windowClosed(MacroButtonDialog.java:149) ~[main/:?]
        at java.awt.AWTEventMulticaster.windowClosed(AWTEventMulticaster.java:368) ~[?:?]
        at java.awt.Window.processWindowEvent(Window.java:2081) ~[?:?]
        at javax.swing.JDialog.processWindowEvent(JDialog.java:686) ~[?:?]
        at java.awt.Window.processEvent(Window.java:2037) ~[?:?]
        at java.awt.Component.dispatchEventImpl(Component.java:4966) ~[?:?]
        at java.awt.Container.dispatchEventImpl(Container.java:2319) ~[?:?]
        at java.awt.Window.dispatchEventImpl(Window.java:2772) ~[?:?]
        at java.awt.Component.dispatchEvent(Component.java:4798) ~[?:?]
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?]
        at java.awt.EventQueue.access$600(EventQueue.java:97) ~[?:?]
        at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?]
        at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) ~[?:?]
        at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?]
        at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?]
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) ~[?:?]
        at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:110) [main/:?]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]

The problematic line appears to be

String id = button.getProperties().getMacroUUID();

To Reproduce
I'm unable to constantly reproduce this.

Expected behavior
No NPE when closing MapTool.

MapTool Info

  • Version: 1.5.2 to 1.5.14, maybe earlier too
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version 10
@Phergus Phergus added the bug label Mar 29, 2020
@Phergus
Copy link
Contributor

Phergus commented Mar 29, 2020

Is this only happening when a campaign is loaded and there are macros on a visible panel?

Perhaps the mouse pointer is hovering over a macro button as the panel is being disposed of and it is trying to get the macro ID to get a tooltip?

@Merudo
Copy link
Member Author

Merudo commented Mar 29, 2020

Maybe? It only happens every now and then and usually by the time I see the error message I forgot what I just did.

@Merudo
Copy link
Member Author

Merudo commented May 14, 2020

The steps in #1495 can be followed to replicate the bug.

Merudo added a commit to Merudo/maptool that referenced this issue May 14, 2020
…twice

- Fix editing a macro which is already being edited creates new Find/Replace entries in Edit menu
- Fix NPE when closing MapTool after creating duplicated find/replace entries
- Fix RPTools#1426 and fix RPTools#1495
Merudo added a commit to Merudo/maptool that referenced this issue May 14, 2020
- Fix editing a macro which is already being edited creates new Find/Replace entries in Edit menu
- Fix NPE when closing MapTool after creating duplicated find/replace entries
- Fix RPTools#1426 and fix RPTools#1495
@Merudo Merudo self-assigned this May 14, 2020
@Merudo
Copy link
Member Author

Merudo commented May 14, 2020

PR #1825 fixes this.

@Phergus
Copy link
Contributor

Phergus commented May 14, 2020

Tested. No longer NPEs on exit after attempting to Edit a macro already open in an editor window.

@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label May 14, 2020
@Phergus Phergus changed the title NPE when closing MapTool NPE when closing MapTool after a macro is opened twice simultaneously for editing. May 15, 2020
@Phergus Phergus closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

2 participants