Closed artem-zinnatullin closed 9 years ago
This decision was made using only sources, without docs. Can it be platform specific? If it's always error state, it's nice idea to follow non-null approach - throw runtime exception.
Documentation for ContentProvider
says that query()
can return Cursor
or null
. In my opinion, if there is no data for this query (eg table is empty) ContentProvider
should return empty cursor, but if such query does not have mapping (eg no such table for uri and so on) it should return null
, which is exceptional case for us and users of StorIO, I guess.
Closed by #451.
At the moment we return empty
MatrixCursor
if original call tocontentResolver.query()
returns null, but in fact ifContentProvider
returnsnull
, it means that this query can not be processed because of some error/exception.So we should throw it as exception.
@nikitin-da and others thoughts?
See: http://stackoverflow.com/questions/13080540/what-causes-androids-contentresolver-query-to-return-null