diff options
| author | 2011-09-09 10:36:09 -0700 | |
|---|---|---|
| committer | 2011-09-09 10:36:09 -0700 | |
| commit | 37f8b51b43c5f5c90062d504608edc8e79c0a5d6 (patch) | |
| tree | b6427e227e1ec2e74754d13178737ee55f8cfcdb | |
| parent | 758c787d7a51456340d37a4f32e3c028ba09caf2 (diff) | |
| parent | 32ef67bb88959e60d2c9c5540603d360852e80f5 (diff) | |
Merge "NPE check in the SyncStateContract BUG:5196483"
| -rw-r--r-- | core/java/android/provider/SyncStateContract.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/provider/SyncStateContract.java b/core/java/android/provider/SyncStateContract.java index e8177ca51572..f1189e409576 100644 --- a/core/java/android/provider/SyncStateContract.java +++ b/core/java/android/provider/SyncStateContract.java @@ -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); |