Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c0c880b authored by Jason Sams's avatar Jason Sams Committed by Android Git Automerger
Browse files

am b04f9944: am 22580b83: Merge "Fix potential npe"

* commit 'b04f9944':
  Fix potential npe
parents 94b17bdd b04f9944
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -363,6 +363,9 @@ public class Mesh extends BaseObj {
                    alloc = Allocation.createTyped(mRS, entry.t, mUsage);
                } else if(entry.e != null) {
                    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;
                vtx[ct] = alloc.getID(mRS);
@@ -375,6 +378,9 @@ public class Mesh extends BaseObj {
                    alloc = Allocation.createTyped(mRS, entry.t, mUsage);
                } else if(entry.e != null) {
                    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);
                indexBuffers[ct] = alloc;