ComaToes / ftl-profile-editor

Profile editor for FTL: Faster Than Light (www.ftlgame.com)
GNU General Public License v3.0
10 stars 38 forks source link

Hi. I am having an error... here's my log :) #5

Open Illarox opened 12 years ago

Illarox commented 12 years ago

12:45:57.792 [AWT-EventQueue-0] ERROR net.blerf.ftl.ui.FTLFrame - Error reading profile java.lang.NullPointerException at net.blerf.ftl.ui.FTLFrame.loadProfile(FTLFrame.java:975) at net.blerf.ftl.ui.FTLFrame$4.actionPerformed(FTLFrame.java:618) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

Vhati commented 12 years ago
971: for( Score s : p.getStats().getTopScores() ) {
...
974:   ShipBlueprint ship = DataManager.get().getShip( s.getShipType() );
975:   stream = DataManager.get().getResourceInputStream("img/ship/"+ship.getImg()+"_base.png");

Looks like getShip() was returning null for some reason? Which is a HashMap lookup, populated in DataManager (line 68). I don't see how a null ship could sneak in there or be omitted, so maybe the profile's Score is referencing a shipId/shipType that doesn't exist.

Adds a print to DataManager's loop at 68. Compares with blueprints.xml for discrepancies...

I've submitted a pull request.

Illarox commented 12 years ago

I might be a little dumb, but what do I do now?

Vhati commented 12 years ago

Just wait for the next update. You did something we didn't think of. : ) The original FTL data files have a few typos in them, which the editor has to correct on-the-fly in order to understand them. If I interpreted your problem correctly, you have a Crystal ship (second layout) in your high scores list. The data file with info about that ship had an uncorrected typo, so the editor ignored the ship on startup. Then in the attempt to read your high scores, the editor couldn't find the Crystal ship's info and it panicked.

Illarox commented 12 years ago

Hi. Is is possible that it happened because a while ago, after getting the quest for 3 times and unlocking the Crystal man I failed to find the beacon and didn't unlock the ship, so I used your editor to unlock it, but only Type A with no achievements? Since then I practically only played with it until I unlocked Type B, and then I've been playing almost only with it.

Vhati commented 12 years ago

Yep. Thanks for confirming.

Having a Crystal Type B in the high scores should be enough to encounter the bug, however it was obtained. The editor crashes when it sees that ship.