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

Campaign properties can't be opened when a hex-shaped light is defined #2970

Closed
kwvanderlinde opened this issue Sep 12, 2021 · 1 comment
Closed
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the bug
If a hex-shaped light is added to in the Campaign Properties, the Campaign Properties cannot be opened again because an NPE is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Open a blank campaign.
  2. Open the Campaign Properties dialog and go to the Light tab.
  3. Edit the "Candle" entry to be a hex-shaped light:
    Candle - 5: hex 5 10#000000
    
  4. Push the OK button
  5. Try opening the Campaign Properties dialog again.
  6. See an exception dialog.

Expected behavior
Hex lights can be defined without breaking the Campaign Properties dialog.

MapTool Info

  • Version: 1.9.3
  • Install: New

Desktop (please complete the following information):

  • OS: Linux Mint
  • Version 20

Additional context

Exception details
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "lastShape" is null
	at net.rptools.maptool.client.ui.campaignproperties.CampaignPropertiesDialog.updateLightPanel(CampaignPropertiesDialog.java:378)
	at net.rptools.maptool.client.ui.campaignproperties.CampaignPropertiesDialog.copyCampaignToUI(CampaignPropertiesDialog.java:225)
	at net.rptools.maptool.client.ui.campaignproperties.CampaignPropertiesDialog.setCampaign(CampaignPropertiesDialog.java:212)
	at net.rptools.maptool.client.AppActions$72.executeAction(AppActions.java:3025)
	at net.rptools.maptool.client.AppActions$ClientAction.execute(AppActions.java:3396)
	at net.rptools.maptool.client.AppActions$ClientAction.actionPerformed(AppActions.java:3428)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
	at de.muntjak.tinylookandfeel.TinyMenuItemUI.doClick(Unknown Source)
	at de.muntjak.tinylookandfeel.TinyMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6617)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6382)
	at java.desktop/java.awt.Container.processEvent(Container.java:2264)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4993)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2322)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4934)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4563)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4504)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2308)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:54)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
@kwvanderlinde kwvanderlinde changed the title Campaign properties can't be open when a hex-shaped light is defined Campaign properties can't be opened when a hex-shaped light is defined Sep 12, 2021
@Phergus Phergus added this to To do in MapTool 1.10.0 via automation Sep 13, 2021
@Phergus Phergus moved this from To do to In progress in MapTool 1.10.0 Sep 13, 2021
@Phergus Phergus moved this from In progress to Review in progress in MapTool 1.10.0 Oct 2, 2021
@Phergus Phergus moved this from Review in progress to Reviewer approved in MapTool 1.10.0 Oct 3, 2021
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Oct 3, 2021
@Phergus
Copy link
Contributor

Phergus commented Oct 3, 2021

Tested. Adding hex-shaped lights no longer causes an exception when re-opening campaign properties.

@Phergus Phergus closed this as completed Oct 3, 2021
@Phergus Phergus moved this from Reviewer approved to Done in MapTool 1.10.0 Oct 3, 2021
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
No open projects
Development

No branches or pull requests

2 participants