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

Commit 37f8b51b authored by Subir Jhanb's avatar Subir Jhanb Committed by Android (Google) Code Review
Browse files

Merge "NPE check in the SyncStateContract BUG:5196483"

parents 758c787d 32ef67bb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -74,6 +74,12 @@ public class SyncStateContract {
                Account account) throws RemoteException {
            Cursor c = provider.query(uri, DATA_PROJECTION, SELECT_BY_ACCOUNT,
                    new String[]{account.name, account.type}, null);

            // Unable to query the provider
            if (c == null) {
                throw new RemoteException();
            }

            try {
                if (c.moveToNext()) {
                    return c.getBlob(c.getColumnIndexOrThrow(Columns.DATA));
@@ -123,6 +129,11 @@ public class SyncStateContract {
                Account account) throws RemoteException {
            Cursor c = provider.query(uri, DATA_PROJECTION, SELECT_BY_ACCOUNT,
                    new String[]{account.name, account.type}, null);

            if (c == null) {
                throw new RemoteException();
            }

            try {
                if (c.moveToNext()) {
                    long rowId = c.getLong(1);