RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
803 stars 263 forks source link

[Bug]: Error when opening .cmpgn file by double-clicking #5022

Open taustinoc opened 1 month ago

taustinoc commented 1 month ago

Describe the Bug

Opening a .cmpgn file by double clicking on it produces the following error:

net.rptools.maptool.model.library.LibraryNotValidException: Lib:Token can no longer be found. at net.rptools.maptool.model.library.token.LibraryToken.findLibrary(LibraryToken.java:401) at net.rptools.maptool.model.library.token.LibraryToken.getProperty(LibraryToken.java:430) at net.rptools.maptool.model.library.token.LibraryToken.getProperty(LibraryToken.java:449) at net.rptools.maptool.model.library.token.LibraryToken.(LibraryToken.java:159) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) at java.base/java.util.ArrayList$ArrayListSpliterator.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.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source) at net.rptools.maptool.model.library.token.LibraryTokenManager$TokenEventListener.lambda$tokensAdded$1(LibraryTokenManager.java:96) 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)

MapTool doesn't crash, but after closing the error, there are no tokens on the map (including a non-library token).

Opening the campaign from the File menu works normally.

To Reproduce

Double click on the attached file to open MapTool.

test.cmpgn.zip

Expected Behaviour

Opening a valid .cmpgn file without error.

Screenshots

No response

MapTool Info

1.14.1 normal Windows install

Desktop

Windows 10 or 11

Additional Context

==== MapTool Information ==== MapTool Version: 1.14.3 MapTool Home...: C:\Users\taustin.maptool-rptools MapTool Install: C:\Users\taustin\AppData\Local\MapTool\app Max mem avail..: 15 GB Max mem used...: 568 MB Custom Property: -DMAPTOOL_LOGDIR=C:\Users\taustin.maptool-rptools\logs Custom Property: -DMAPTOOL_DATADIR=.maptool-rptools

==== Java Information ==== Java Home......: C:\Users\taustin\AppData\Local\MapTool\runtime Java Vendor....: Eclipse Adoptium Java Version...: 20.0.1 Java Parameters: -Djpackage.app-version=1.0 -Xss8M -Dsun.java2d.d3d=false -Dsentry.environment=Production -Dfile.encoding=UTF-8 -Dpolyglot.engine.WarnInterpreterOnly=false -Djava.util.Arrays.useLegacyMergeSort=true -XX:+ShowCodeDetailsInExceptionMessages --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED --add-opens=java.desktop/sun.awt.geom=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit.dom=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED --add-opens=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED -Djpackage.app-path=C:\Users\taustin\AppData\Local\MapTool\MapTool.exe

==== OS Information ==== OS Name........: Windows 11 OS Version.....: 10.0 OS Architecture: amd64 Processor......: Intel64 Family 6 Model 183 Stepping 1, GenuineIntel PATH...........: C:\Users\taustin\AppData\Local\MapTool;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\taustin\AppData\Local\Microsoft\WindowsApps;;C:\Users\taustin\AppData\Local\MapTool\app;. Number of Procs: 32

==== User Information ==== User Name: taustin User Home: C:\Users\taustin User Dir.: C:\Users\taustin\AppData\Local\MapTool

==== Network Interfaces ==== Display Name..: Software Loopback Interface 1 Interface Name: lo Address...: 127.0.0.1 Address...: 0:0:0:0:0:0:0:1

Display Name..: Intel(R) Ethernet Connection (17) I219-LM Interface Name: eth1 Address...: 192.168.1.114 Address...: fe80:0:0:0:3ea4:4c75:de6f:facc%eth1

Host Address...: 192.168.1.114 Default Gateway: 192.168.1.10

==== Locale Information ==== Country.: United States Language: English Locale..: English (United States) Variant.:

==== Encoding Information ==== Default Locale: en_US Default Charset: UTF-8 file.encoding: UTF-8 sun.jnu.encoding: Cp1252 Default Encoding: UTF8

==== Display Information ==== Number of Displays: 2 Display 1: 1920x1080(32) Display 2: 1920x1080(32)

==== Internet Gateway Devices ==== No IGDs Found!

kwvanderlinde commented 1 month ago

I take a closer look later, but this looks like a duplicate of #4654. Should be fixed in 1.16 or whatever we call the next version.