diff --git a/framework/src/com/phonegap/Device.java b/framework/src/com/phonegap/Device.java index 074f72f5..922fd01f 100644 --- a/framework/src/com/phonegap/Device.java +++ b/framework/src/com/phonegap/Device.java @@ -57,9 +57,11 @@ public class Device{ { Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone notification = RingtoneManager.getRingtone(mCtx, ringtone); - for (long i = 0; i < pattern; ++i) - { - notification.play(); + if (notification != null) { // This will be the case when the phone is set to silent for example + for (long i = 0; i < pattern; ++i) + { + notification.play(); + } } }