leaningtech/cheerpj-meta

StackTraceElement.html#getFileName() returns null

tytot opened this issue · 4 comments

tytot commented

I have an executable (Java Swing) JAR that I converted using CheerpJ 2.3 on Ubuntu. When I try to run the application in an HTML page per the tutorial, the frame remains white and I get an Unhandled exception N4java4lang20NullPointerException / in the console.

Minimal reproducible example: https://github.com/tytot/cheerpj-demo

The problem with this application is that is tries to access the filename of stack trace elements unconditionally, while they are actually allowed to be null.

https://docs.oracle.com/javase/7/docs/api/java/lang/StackTraceElement.html#getFileName()

I'll keep this bug open since we might be able to fix this as part of the upcoming CheerpJ 3.0 architecture, but the program is our opinion buggy to begin with.

CheerpJ 3.0 is now available. Let us know if you still have this issue using CheerpJ 3.0 @tytot. As Alessandro said, the application is arguably buggy, but it might work now anyway.

Thanks for letting me know, I upgraded and I'm no longer experiencing the error.

Awesome!