Skip to content

Commit

Permalink
GLRenderer: avoid NPE reported by Pavl_G (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Apr 25, 2021
1 parent e5899ff commit 81d5ca6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,8 @@ public void clearVertexAttribs() {
for (int i = 0; i < attribList.oldLen; i++) {
int idx = attribList.oldList[i];
gl.glDisableVertexAttribArray(idx);
if (context.boundAttribs[idx].get().isInstanced()) {
VertexBuffer buffer = context.boundAttribs[idx].get();
if (buffer != null && buffer.isInstanced()) {
glext.glVertexAttribDivisorARB(idx, 0);
}
context.boundAttribs[idx] = null;
Expand Down

0 comments on commit 81d5ca6

Please sign in to comment.