avoid NPE for sketches w/o size() (fixes #3585)

This commit is contained in:
Ben Fry
2015-08-12 14:43:43 -04:00
parent 2ffa92470f
commit 097ddfca54
3 changed files with 13 additions and 6 deletions

View File

@@ -2,6 +2,8 @@
opengl
X filter(PShader) broken in HDPI mode
X https://github.com/processing/processing/issues/3577
_ Use PBOs for async texture copy
_ https://github.com/processing/processing/issues/3569
_ filter(PShader) broken in HiDPI mode

View File

@@ -29,8 +29,8 @@ import processing.data.StringList;
public class SurfaceInfo {
// String statement;
StringList statements;
StringList statements = new StringList();
String width;
String height;
String renderer;
@@ -119,9 +119,6 @@ public class SurfaceInfo {
* matched against and removed from the size() method in the code.
*/
public void addStatement(String stmt) {
if (statements == null) {
statements = new StringList();
}
statements.append(stmt);
}
@@ -133,7 +130,7 @@ public class SurfaceInfo {
/** @return true if there's code to be inserted for a settings() method. */
public boolean hasSettings() {
return statements != null;
return statements.size() != 0;
}

View File

@@ -1,4 +1,10 @@
0242 (3.0b4)
X Fix NullPointerException with some sketches that have no size() command
X https://github.com/processing/processing/issues/3585
gsoc
X Second round of arm patches (v5)
X https://github.com/processing/processing/pull/3583
known issues
@@ -8,6 +14,8 @@ _ but anything else reports "font sadness" b/c it's using the system JRE
_ https://github.com/processing/processing/issues/3543
_ move to javapackager or another option?
_ http://www.excelsiorjet.com/kb/35/howto-create-a-single-exe-from-your-java-application
_ P2D and P3D windows behave strangely when larger than the screen size
_ https://github.com/processing/processing/issues/3401
_ mouse events (i.e. toggle breakpoint) seem to be firing twice