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

Commit 5c5dfd0a authored by Brian Muramatsu's avatar Brian Muramatsu Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in SQLiteDatabase#updateWithOnConflict"

parents 54511bb6 46a88513
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1772,8 +1772,7 @@ public class SQLiteDatabase extends SQLiteClosable {
     */
    public int updateWithOnConflict(String table, ContentValues values,
            String whereClause, String[] whereArgs, int conflictAlgorithm) {
        int setValuesSize = values.size();
        if (values == null || setValuesSize == 0) {
        if (values == null || values.size() == 0) {
            throw new IllegalArgumentException("Empty values");
        }

@@ -1784,6 +1783,7 @@ public class SQLiteDatabase extends SQLiteClosable {
        sql.append(" SET ");

        // move all bind args to one array
        int setValuesSize = values.size();
        int bindArgsSize = (whereArgs == null) ? setValuesSize : (setValuesSize + whereArgs.length);
        Object[] bindArgs = new Object[bindArgsSize];
        int i = 0;