processing4 icon indicating copy to clipboard operation
processing4 copied to clipboard

`Cannot invoke "processing.app.SketchCode.isModified()" because "this.current" is null`

Open catem-code opened this issue 2 years ago • 9 comments

java. lang. NullPointerException: Cannot invoke "processing.app.SketchCode.isModified ()" because

"this.current" is null

at processing.app. Sketch. setModified (Sketch. java: 760) at processing. mode. java. JavaEditor. (JavaEditor. java: 119) at processing. mode. java. JavaMode. createEditor (JavaMode. java: 44) at processing. app. Base. handleOpenInternal (Base. java: 1613) at processing. app. Base. handleOpen (Base. java: 1482) at processing. app. Base. handleOpenPrompt (Base. java: 1178) at processing.app.u. Editor. lambda$buildFileMenus4 (Editor.¡ava:662) 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(DevaultButtonModel.ava:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.pilaf.basic.Bas ricMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt. Component. processMouseEvent (Component. java: 6626) at java. desktop/javax. swing. JComponent. processMouseEvent (JComponent. java: 3389) at java.desktop/java.awt. Component. processEvent (Component. java: 6391) java.desktop/java.awt.Container.processEvent(Container. java:2266)

at java.desktop/java awt. Component. dispatchEventImpl (Component java: 5001)

java.desktop/java.

awt. Container.dispatchEventImpl (Container java: 2324)

at java.desktop/java. awt. Component. dispatchEvent (Component. java: 4833) at java. desktop/java.awt. LightweightDispatcher.retargetMouseEvent(Container.java: 4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt

LightweightDispatcher _dispatchEvent (Container: java: 4516)

at java.desktop/java

Container. dispatchEventImpl(Container java:2310)

at java.desktop/java

Ewindow

• dispatchEventIm pl (window. java:2780)

java.desktop/java.aw

(Component

L.ja va: 4833)

at java.desktop/java

chEventImpl(EventQueue.java: 773

CHET

java.desktop/java at java.desktop/java.awt at java.base/java.securit

a: 399

at java.base/java, security. ProtectionDomainsJavase at java.base/java. security. ProtectionDomainsJav

ege (ProtectionDomain. java: 86)

ege (ProtectionDomain. java: 97)

at java.desktop/java. awt. EventQueue$5 run (EventQueue. java: 7. at java.desktop/java.awt. EventQueue$5. run (EventQueue. java: 742 at java.base/java.secur

Arcasstonrrores

at lava.base java.secur

tectionDomain$J.

ProtectionDomain, ¡ava: 86)

at lava.desktop/Java.awl

:203

at lava.desktop/java.awt.Eventospatc at java.desktop/java.awt. EventDispatchThread.pumpEventsForFilter(EventDispatchThread at java. desktop/java.awt. EventDispatchThread.pumpEventsForHierarchy (EventDispatchT at java.desktop/java. awt. EventDispatchThread.pumpEvents (EventDispatchThread. at java.desktop/java.avt.EventDispatchThread.pumpEvents(EventDispatchThread.

Q

catem-code avatar May 15 '23 20:05 catem-code

The same error Here.

janebeta7 avatar May 22 '23 12:05 janebeta7

Hello @catem-code and @janebeta7,

Thank you for bringing this issue to our attention. To better understand and troubleshoot the error, could you please provide more context?

  • What were you doing when the error occurred?
  • Is this a recurring error or did it only happen once?
  • Can you provide your environment details? (OS, Java version, Processing version)

These details would be really helpful for us to investigate further.

SableRaf avatar Jun 02 '23 13:06 SableRaf

It looks like this happened when opening a sketch, so a couple more questions:

  • Was it actually a sketch folder? (This error could happen if the editor isn't able to find any source code in the folder.)
  • Does it happen consistently with that folder? (If so, can you share it?)

benfry avatar Jul 16 '23 17:07 benfry

It looks like this happened when opening a sketch, so a couple more questions:

* Was it actually a sketch folder? (This error could happen if the editor isn't able to find any source code in the folder.)

* Does it happen consistently with that folder? (If so, can you share it?)

I solved the problem. The sketch.properties file did not exist so I copied this file from another sketch and it worked.

janebeta7 avatar Jul 25 '23 11:07 janebeta7

Were you using p5.js Mode or something like that?

benfry avatar Jul 25 '23 21:07 benfry

Were you using p5.js Mode or something like that?

Yes, p5.js

janebeta7 avatar Jul 26 '23 09:07 janebeta7

Ok, opening a new issue over here: https://github.com/fathominfo/processing-p5js-mode/issues/30

Is there anything you can tell me about how the sketch was made? Did you create it, close it, and then re-open it? Was it immediate or after several days? Has it been re-saved multiple times? I'm just trying to figure out how the sketch.properties file went missing so I can fix it.

benfry avatar Jul 26 '23 09:07 benfry

I got the same thing when using the Python mode in Processing 4.3. I have just installed Processing so not much baggage is needed to reproduce it:

  1. Download Processing
  2. Install Python mode
  3. Switch to python mode
  4. Save your sketch (I saved mine to a non-default path)
  5. Restart Processing
  6. Try to open the saved sketch
  7. Get NPE mentioned in this thread

Note: it does not happen if you save in the default location.

seanhoughton avatar Feb 10 '24 21:02 seanhoughton

Ok, opening a new issue over here: fathominfo/processing-p5js-mode#30

Is there anything you can tell me about how the sketch was made? Did you create it, close it, and then re-open it? Was it immediate or after several days? Has it been re-saved multiple times? I'm just trying to figure out how the sketch.properties file went missing so I can fix it.

Hi Ben, unfortunately I can't give you much information, because I'm not aware of when the file disappeared, perhaps in a poorly executed folder copy.

janebeta7 avatar Feb 14 '24 12:02 janebeta7