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

[Bug]: Tokens generating NullPointerException error on 1.13.0 using campaign created in previous public version (1.12.2) #4037

Closed
Alexpop11 opened this issue May 6, 2023 · 4 comments
Assignees
Labels

Comments

@Alexpop11
Copy link

Describe the Bug

Using a campaign file that was created with the previous version of maptool, placing a .png on the map (and therefore creating a token) generates the following error:

java.lang.NullPointerException at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.Collections$2.tryAdvance(Unknown Source) at java.base/java.util.Collections$2.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.reduce(Unknown Source) at java.base/java.util.stream.ReferencePipeline.max(Unknown Source) at net.rptools.maptool.client.ui.zone.ZoneView.illuminationKeyFromView(ZoneView.java:443) at net.rptools.maptool.client.ui.zone.ZoneView.getIllumination(ZoneView.java:514) at net.rptools.maptool.client.ui.zone.ZoneView.getVisibleArea(ZoneView.java:616) at net.rptools.maptool.client.ui.zone.ZoneRenderer.renderVisionOverlay(ZoneRenderer.java:1712) at net.rptools.maptool.client.ui.zone.ZoneRenderer.renderGMVisionOverlay(ZoneRenderer.java:1704) at net.rptools.maptool.client.ui.zone.ZoneRenderer.renderZone(ZoneRenderer.java:1335) at net.rptools.maptool.client.ui.zone.ZoneRenderer.paintComponent(ZoneRenderer.java:822) at java.desktop/javax.swing.JComponent.paint(Unknown Source) at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source) at java.desktop/javax.swing.JComponent.paint(Unknown Source) at java.desktop/javax.swing.JComponent.paintToOffscreen(Unknown Source) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(Unknown Source) at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) at java.desktop/javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at java.desktop/javax.swing.RepaintManager.paint(Unknown Source) at java.desktop/javax.swing.JComponent._paintImmediately(Unknown Source) at java.desktop/javax.swing.JComponent.paintImmediately(Unknown Source) at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source) at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source) at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source) at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source) at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:54) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

To Reproduce

  1. Open previously existing campaign from Maptool 1.12.2
  2. Create new default map
  3. Drag and drop PNG file into maptool map, on Token layer
  4. hover mouse over token

Expected Behaviour

No errors, as with the previous version

Screenshots

Screenshot 2023-05-06 155127

MapTool Info

Version 1.13.0 Upgrade [1.12.2]

Desktop

Windows 11

Additional Context

No response

@Alexpop11 Alexpop11 added the bug label May 6, 2023
@Azhrei
Copy link
Member

Azhrei commented May 7, 2023

Potential issue with lighting? @kwvanderlinde

@kwvanderlinde
Copy link
Collaborator

This doesn't look to be related to upgrading specifically. Here's an alternative reproduction:

  1. Start a new campaign in 1.13.0
  2. Edit > Campaign Properties, Sight tab, delete the "Normal" vision and hit "OK"
  3. Drag an image onto the Token layer.
  4. Hover over the token to get a NPE

What happens is that - until a token is edited - it defaults to a sight type of "Normal", regardless of whether the campaign actually has such a sight type. And there's one place where I missed that possibility, causing the NPE.

@kwvanderlinde kwvanderlinde moved this from Todo to In Progress in MapTool 1.13.0 May 25, 2023
@kwvanderlinde kwvanderlinde moved this from In Progress to Needs Testing in MapTool 1.13.0 May 25, 2023
@Pmofmalasia
Copy link

Fixed for me using the reproduction method (deleting "Normal" vision) in 1.13.2.

@JarieSuisen
Copy link

Same. With the latest update I haven't had any troubles with this.

@github-project-automation github-project-automation bot moved this from Needs Testing to Merged in MapTool 1.13.0 Jul 19, 2023
@kwvanderlinde kwvanderlinde moved this from Merged to Done in MapTool 1.13.0 Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

5 participants