Skip to content

Commit 3b55353

Browse files
sdhukadiv5yesh
andauthored
fix(pinpoint): Add null check to prevent NPE (#3274)
Co-authored-by: Divyesh Chitroda <[email protected]>
1 parent c3c66f2 commit 3b55353

File tree

1 file changed

+5
-3
lines changed
  • aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event

1 file changed

+5
-3
lines changed

aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/EventRecorder.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,11 @@ private boolean isClientExceptionRetryable(Throwable amazonClientException) {
556556
if (!isNetworkAvailable(pinpointContext.getApplicationContext())) {
557557
return true;
558558
}
559-
return amazonClientException.getCause() != null &&
560-
(amazonClientException.getCause() instanceof UnknownHostException ||
561-
amazonClientException.getCause() instanceof SocketException);
559+
return amazonClientException != null &&
560+
amazonClientException.getCause() != null &&
561+
( amazonClientException.getCause() instanceof UnknownHostException ||
562+
amazonClientException.getCause() instanceof SocketException
563+
);
562564
}
563565

564566
/**

0 commit comments

Comments
 (0)