Prevent crash

pull/155/head 1.443
M66B 6 years ago
parent ac65abebb2
commit c440309c78

@ -1675,11 +1675,10 @@ class Core {
if (light)
builder.setLights(Color.GREEN, 1000, 1000);
if (sound == null) {
Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Uri uri = (sound == null ? null : Uri.parse(sound));
if (uri == null || "file".equals(uri.getScheme()))
uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
builder.setSound(uri);
} else
builder.setSound(Uri.parse(sound));
builder.setOnlyAlertOnce(true);
} else

@ -828,6 +828,8 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
if (resultCode == RESULT_OK) {
Uri uri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
Log.i("Selected ringtone=" + uri);
if (uri != null && "file".equals(uri.getScheme()))
uri = null;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
if (uri == null)

Loading…
Cancel
Save