From 78f1ba6dde64ae35b045b6b5d8ff94654e51d9c1 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 21 May 2019 13:18:27 -0700 Subject: [PATCH] fix npe sending relay invites to self Needed to handle the case where both are null. Can't reproduce this in release builds so likely doesn't justify a new release. --- .../main/java/org/eehouse/android/xw4/XWJIService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWJIService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWJIService.java index 927deeb3f..2be71a0f8 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWJIService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWJIService.java @@ -204,7 +204,14 @@ abstract class XWJIService extends JobIntentService { Object obj1 = bundle1.get( key ); Object obj2 = bundle2.get( key ); - if ( obj1.getClass() != obj2.getClass() ) { + if ( obj1 == obj2 ) { // catches case where both null + continue; + } else if ( obj1 == null || obj2 == null ) { + equal = false; + break; + } + + if ( obj1.getClass() != obj2.getClass() ) { // NPE equal = false; break; }