From 78733ad48f12860727475b5c9e805c1caa8c34a6 Mon Sep 17 00:00:00 2001 From: "James.cf Lin" Date: Tue, 29 Jun 2021 04:06:23 +0800 Subject: [UCE] Fix NPE in the RcsContactUceCapability When get the RcsContactPresenceTuple from the RcsContactUceCapability, it should check whether the servier ID is null or not Bug: 191836903 Test: atest RcsContactUceCapabilityTest Change-Id: I987c6f1fbcabfe64688f1d71210c83b6c4d8d9e0 --- telephony/java/android/telephony/ims/RcsContactUceCapability.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/ims/RcsContactUceCapability.java b/telephony/java/android/telephony/ims/RcsContactUceCapability.java index 530003d6350a..91121187a19a 100644 --- a/telephony/java/android/telephony/ims/RcsContactUceCapability.java +++ b/telephony/java/android/telephony/ims/RcsContactUceCapability.java @@ -331,7 +331,7 @@ public final class RcsContactUceCapability implements Parcelable { return null; } for (RcsContactPresenceTuple tuple : mPresenceTuples) { - if (tuple.getServiceId().equals(serviceId)) { + if (tuple.getServiceId() != null && tuple.getServiceId().equals(serviceId)) { return tuple; } } -- cgit v1.2.3