Properly return zero-count cursor from getMatrixCursor

Change-Id: I574528bf56b5a82ecbaab3d3501b26e7afb974ec
This commit is contained in:
Marc Blank 2010-12-20 13:58:11 -08:00
parent 0698f4027f
commit d9b251d23b

View File

@ -525,6 +525,9 @@ public final class ContentCache extends LinkedHashMap<String, Cursor> {
if (c != null) {
// Make a new MatrixCursor with the requested columns
MatrixCursor mc = new MatrixCursor(projection, 1);
if (c.getCount() == 0) {
return mc;
}
Object[] row = new Object[projection.length];
if (values != null) {
// Make a copy; we don't want to change the original