forked from mirror/monocles_chat
code clean up [Daniel Gultsch]
This commit is contained in:
parent
db3a73bf42
commit
f607cee55f
1 changed files with 7 additions and 3 deletions
|
@ -584,11 +584,15 @@ public final class MimeUtils {
|
|||
}
|
||||
|
||||
private static String getDisplayName(final Context context, final Uri uri) {
|
||||
try (Cursor cursor = context.getContentResolver().query(uri, null, null, null, null)) {
|
||||
try (final Cursor cursor = context.getContentResolver().query(uri, null, null, null, null)) {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
return cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
|
||||
final int index = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
|
||||
if (index == -1) {
|
||||
return null;
|
||||
}
|
||||
return cursor.getString(index);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue