Skip to content

Commit

Permalink
Crash: return default value for edge case in getRemoteFileModifiedDate
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Dec 31, 2024
1 parent a763ddf commit 3229918
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,11 @@ private DocFileMetadata getRemoteMetadata(DatabaseMetadata metadata) {
}

private DocFileMetadata getRemoteMetadata(Uri uri) {
Context host = _host;

DocFileMetadata result = new DocFileMetadata();
result.Uri = uri.toString();
result.lastModified = new MmxDate(0);

try (Cursor cursor = host.getContentResolver().query(uri, null, null, null, null, null)) {
try (Cursor cursor = _host.getContentResolver().query(uri, null, null, null, null, null)) {
if (cursor == null || !cursor.moveToFirst()) {
Timber.w("Cursor is null or empty for URI: %s", uri);
return result;
Expand Down

0 comments on commit 3229918

Please sign in to comment.