am 040ad494
: Merge "Handle unexpected null cursor and don\'t forget to close it."
* commit '040ad494c5560e83ab8c0414b303aa3f1e1f34bf': Handle unexpected null cursor and don't forget to close it.
This commit is contained in:
@@ -351,9 +351,12 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
||||
try {
|
||||
Cursor cursor = context.getContentResolver().query(ringtoneUri,
|
||||
new String[] { MediaStore.Audio.Media.TITLE }, null, null, null);
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
summary = cursor.getString(0);
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
} catch (SQLiteException sqle) {
|
||||
// Unknown title for the ringtone
|
||||
}
|
||||
|
Reference in New Issue
Block a user