mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
fixed bug for empty sketches
This commit is contained in:
@@ -81,7 +81,8 @@ public class PdePreprocessor {
|
||||
String extraImports[]) throws java.lang.Exception {
|
||||
// if the program ends with no CR or LF an OutOfMemoryError will happen.
|
||||
// not gonna track down the bug now, so here's a hack for it:
|
||||
if (program.charAt(program.length()-1) != '\n') {
|
||||
if ((program.length() > 0) &&
|
||||
program.charAt(program.length()-1) != '\n') {
|
||||
program += "\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user