don't crash if intent is null

This commit is contained in:
Eric House 2015-07-11 07:53:22 -07:00
parent 9c7213e42b
commit ec393bc0c8

View file

@ -204,9 +204,9 @@ public class Utils {
Intents is to send a different second param each time,
though the docs say that param's ignored.
*/
PendingIntent pi =
PendingIntent.getActivity( context, Utils.nextRandomInt(), intent,
PendingIntent.FLAG_ONE_SHOT );
PendingIntent pi = null == intent ? null
: PendingIntent.getActivity( context, Utils.nextRandomInt(), intent,
PendingIntent.FLAG_ONE_SHOT );
Notification notification =
new Notification( R.drawable.icon48x48, title,