Skip to content

Commit fb038a9

Browse files
committed
avoid NPE for sketches w/o size() (fixes processing#3585)
1 parent 95d50fc commit fb038a9

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

core/todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33

44
opengl
5+
X filter(PShader) broken in HDPI mode
6+
X https://github.com/processing/processing/issues/3577
57
_ Use PBOs for async texture copy
68
_ https://github.com/processing/processing/issues/3569
79
_ filter(PShader) broken in HiDPI mode

java/src/processing/mode/java/preproc/SurfaceInfo.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030

3131
public class SurfaceInfo {
32-
// String statement;
33-
StringList statements;
32+
StringList statements = new StringList();
33+
3434
String width;
3535
String height;
3636
String renderer;
@@ -119,9 +119,6 @@ public StringList getStatements() {
119119
* matched against and removed from the size() method in the code.
120120
*/
121121
public void addStatement(String stmt) {
122-
if (statements == null) {
123-
statements = new StringList();
124-
}
125122
statements.append(stmt);
126123
}
127124

@@ -133,7 +130,7 @@ public void addStatements(StringList list) {
133130

134131
/** @return true if there's code to be inserted for a settings() method. */
135132
public boolean hasSettings() {
136-
return statements != null;
133+
return statements.size() != 0;
137134
}
138135

139136

todo.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
0242 (3.0b4)
2+
X Fix NullPointerException with some sketches that have no size() command
3+
X https://github.com/processing/processing/issues/3585
4+
5+
gsoc
6+
X Second round of arm patches (v5)
7+
X https://github.com/processing/processing/pull/3583
28

39

410
known issues
@@ -8,6 +14,8 @@ _ but anything else reports "font sadness" b/c it's using the system JRE
814
_ https://github.com/processing/processing/issues/3543
915
_ move to javapackager or another option?
1016
_ http://www.excelsiorjet.com/kb/35/howto-create-a-single-exe-from-your-java-application
17+
_ P2D and P3D windows behave strangely when larger than the screen size
18+
_ https://github.com/processing/processing/issues/3401
1119
_ mouse events (i.e. toggle breakpoint) seem to be firing twice
1220

1321

0 commit comments

Comments
 (0)