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

Commit 32ef67bb authored by Subir Jhanb's avatar Subir Jhanb
Browse files

NPE check in the SyncStateContract

BUG:5196483

Change-Id: I9fe170037f7a3d7a98583d1330099246230d3859
parent 3adb1809
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);