fixed bug for empty sketches

This commit is contained in:
benfry
2004-07-12 22:06:35 +00:00
parent d13973f75a
commit 7cb7bb8170

View File

@@ -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";
}