processing / processing4

Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. There are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning and prototyping.
https://processing.org
Other
15 stars 3 forks source link

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

Open processing-bot opened 1 year ago

processing-bot commented 1 year ago

Created by: catem-code

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

processing-bot commented 1 year ago

Created by: benfry

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

processing-bot commented 1 year ago

Created by: benfry

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

processing-bot commented 1 year ago

Created by: SableRaf

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?

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

processing-bot commented 1 year ago

Created by: benfry

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.

processing-bot commented 1 year ago

In GitLab by @albagcorral on May 22, 2023, 14:07

The same error Here.

processing-bot commented 1 year ago

In GitLab by @albagcorral on Jul 25, 2023, 13:42

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.

processing-bot commented 1 year ago

In GitLab by @albagcorral on Jul 26, 2023, 11:20

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

Yes, p5.js

processing-bot commented 9 months ago

Created by: seanhoughton

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.

processing-bot commented 9 months ago

In GitLab by @albagcorral on Feb 14, 2024, 13:21

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.