b368 preview - error deleting custom block [b368]

Greg

  • *
  • Posts: 1260
I'm on the newest b368 preview, with the undo/redo feature in Design Mode.  I have a feeling this is related.  I created a custom block and then tried deleting it.  Nothing happened visually but I saw this error -

Code: [Select]
java.lang.NullPointerException
        at stencyl.sw.editors.snippet.designer.EditArea$14.actionPerformed(EditA
rea.java:2311)
        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.AbstractButton.doClick(Unknown Source)
        at com.jidesoft.plaf.vsnet.VsnetMenuItemUI.doClick(Unknown Source)
        at com.jidesoft.plaf.vsnet.VsnetMenuItemUI$MouseInputHandler.mouseReleas
ed(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.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)
java.lang.NullPointerException
        at stencyl.sw.editors.snippet.designer.EditArea$14.actionPerformed(EditA
rea.java:2311)
        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.AbstractButton.doClick(Unknown Source)
        at com.jidesoft.plaf.vsnet.VsnetMenuItemUI.doClick(Unknown Source)
        at com.jidesoft.plaf.vsnet.VsnetMenuItemUI$MouseInputHandler.mouseReleas
ed(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.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)
[LOG] Unexpected problem on thread AWT-EventQueue-0: null

Joe

  • *
  • Posts: 2480
Jon did say that undo/redo isn't yet supported for custom blocks, but I doubt that means it should be causing a NPE.

Patch 4 is up. Update sw.jar again to pick it up.

The major addition is Undo/Redo support in Design Mode thanks to Matt. It works for everything except the corner cases of...

1) Custom Blocks
2) Multi-line code blocks
3) Edits to attributes themselves.

Everything else should work, and if not, Matt will patch things up as we go along.

Greg

  • *
  • Posts: 1260
Yeah, I actually wasn't trying to undo or redo anything.  It was just the deletion of the block that led to the error. 

Matt_S

  • Posts: 46
That null pointer exception seems to be suggesting that custom blocks don't belong to a group; nonetheless, the code now checks for that, and I also fixed a bug with an accidental double deletion that can rarely pop up in other places.  However, I'm now getting concurrent modification exceptions in a method that I don't recall ever changing, and the exception doesn't seem to happen in my pre-undo version of SW.

Edit: I think I found my offending change.  Let's see if it fixes the error, and still generally works.

« Last Edit: April 06, 2011, 07:10:37 pm by Matt_S »

Matt_S

  • Posts: 46
Alright, this should be fixed, and nothing appears to have broken.  Changes have been committed.


Jon

  • *
  • Posts: 17529
Greg - did you verify the fix off SVN?