Skip to content

Commit

Permalink
Merge pull request #3553 from JakubValtar/bugfix-pshape-setvertex
Browse files Browse the repository at this point in the history
Fix null pointer exception in setVertex
  • Loading branch information
benfry committed Aug 8, 2015
2 parents 4b860a2 + 974d9a5 commit 580316b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/processing/opengl/PShapeOpenGL.java
Expand Up @@ -1708,17 +1708,17 @@ public void setVertex(int index, float x, float y, float z) {
return;
}

if (vertexCodes[index] != VERTEX) {
PGraphics.showWarning(NOT_A_SIMPLE_VERTEX, "setVertex()");
return;
}

// TODO: in certain cases (kind = TRIANGLE, etc) the correspondence between
// input and tessellated vertices is 1-1, so in those cases re-tessellation
// wouldn't be necessary. But in order to reasonable take care of that
// situation, we would need a complete rethinking of the rendering architecture
// in Processing :-)
if (family == PATH) {
if (vertexCodes != null && vertexCodeCount > 0 &&
vertexCodes[index] != VERTEX) {
PGraphics.showWarning(NOT_A_SIMPLE_VERTEX, "setVertex()");
return;
}
vertices[index][X] = x;
vertices[index][Y] = y;
if (is3D) vertices[index][Z] = z;
Expand Down

0 comments on commit 580316b

Please sign in to comment.