Merge "Fix potential npe"
This commit is contained in:
@ -363,6 +363,9 @@ public class Mesh extends BaseObj {
|
|||||||
alloc = Allocation.createTyped(mRS, entry.t, mUsage);
|
alloc = Allocation.createTyped(mRS, entry.t, mUsage);
|
||||||
} else if(entry.e != null) {
|
} else if(entry.e != null) {
|
||||||
alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage);
|
alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage);
|
||||||
|
} else {
|
||||||
|
// Should never happen because the builder will always set one
|
||||||
|
throw new IllegalStateException("Builder corrupt, no valid element in entry.");
|
||||||
}
|
}
|
||||||
vertexBuffers[ct] = alloc;
|
vertexBuffers[ct] = alloc;
|
||||||
vtx[ct] = alloc.getID(mRS);
|
vtx[ct] = alloc.getID(mRS);
|
||||||
@ -375,6 +378,9 @@ public class Mesh extends BaseObj {
|
|||||||
alloc = Allocation.createTyped(mRS, entry.t, mUsage);
|
alloc = Allocation.createTyped(mRS, entry.t, mUsage);
|
||||||
} else if(entry.e != null) {
|
} else if(entry.e != null) {
|
||||||
alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage);
|
alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage);
|
||||||
|
} else {
|
||||||
|
// Should never happen because the builder will always set one
|
||||||
|
throw new IllegalStateException("Builder corrupt, no valid element in entry.");
|
||||||
}
|
}
|
||||||
long allocID = (alloc == null) ? 0 : alloc.getID(mRS);
|
long allocID = (alloc == null) ? 0 : alloc.getID(mRS);
|
||||||
indexBuffers[ct] = alloc;
|
indexBuffers[ct] = alloc;
|
||||||
|
Reference in New Issue
Block a user