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

Commit b2679481 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix potential NPE in SQLiteProgram.

Bug: 6122537
Change-Id: I76a12f58f08b708065dfdd11c78f54701d90873b
parent 8ac70c42
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -64,20 +64,20 @@ public abstract class SQLiteProgram extends SQLiteClosable {
                break;
        }

        if (mNumParameters != 0) {
            mBindArgs = new Object[mNumParameters];
        } else {
            mBindArgs = null;
        }

        if (bindArgs != null) {
            if (bindArgs.length > mNumParameters) {
        if (bindArgs != null && bindArgs.length > mNumParameters) {
            throw new IllegalArgumentException("Too many bind arguments.  "
                    + bindArgs.length + " arguments were provided but the statement needs "
                    + mNumParameters + " arguments.");
        }

        if (mNumParameters != 0) {
            mBindArgs = new Object[mNumParameters];
            if (bindArgs != null) {
                System.arraycopy(bindArgs, 0, mBindArgs, 0, bindArgs.length);
            }
        } else {
            mBindArgs = null;
        }
    }

    final SQLiteDatabase getDatabase() {