Skip to content

Commit faab7b8

Browse files
committed
Initialize sketch args before calling settings()
1 parent 291f7c8 commit faab7b8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/src/processing/core/PApplet.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10231,6 +10231,13 @@ static public void runSketch(final String[] args,
1023110231
// }
1023210232
sketch.sketchPath = folder;
1023310233

10234+
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
10235+
if (args.length != argIndex + 1) {
10236+
// pass everything after the class name in as args to the sketch itself
10237+
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
10238+
sketch.args = PApplet.subset(args, argIndex + 1);
10239+
}
10240+
1023410241
// Call the settings() method which will give us our size() call
1023510242
// try {
1023610243
sketch.handleSettings();
@@ -10252,13 +10259,6 @@ static public void runSketch(final String[] args,
1025210259
// //fullScreen |= sketch.sketchFullScreen();
1025310260
// sketch.fullScreen |= fullScreen;
1025410261

10255-
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
10256-
if (args.length != argIndex + 1) {
10257-
// pass everything after the class name in as args to the sketch itself
10258-
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
10259-
sketch.args = PApplet.subset(args, argIndex + 1);
10260-
}
10261-
1026210262
sketch.external = external;
1026310263

1026410264
if (windowColor != 0) {

0 commit comments

Comments
 (0)