From ec393bc0c8fc903d957ecc004e8c3c8109e2da6e Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 11 Jul 2015 07:53:22 -0700 Subject: [PATCH] don't crash if intent is null --- .../android/XWords4/src/org/eehouse/android/xw4/Utils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java index 8f9b6a8cd..525dbccb2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java @@ -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,