Fix potential error copying null conference participant list.
Tyler Gunn [Wed, 24 Aug 2016 04:05:25 +0000 (21:05 -0700)]
In some cases, mConferenceParticipants can be null, causing the copy
code to crash the com.android.phone app.

Adding appropriate null/empty checks to prevent this.

Bug: 31044679
Change-Id: I9ee464281af8213c03705d054500b8c5e2f12f05

src/java/com/android/ims/ImsCall.java

index b6590f8..6812b04 100644 (file)
@@ -731,6 +731,12 @@ public class ImsCall implements ICall {
         synchronized(mLockObj) {
             logi("getConferenceParticipants :: mConferenceParticipants"
                     + mConferenceParticipants);
+            if (mConferenceParticipants == null) {
+                return null;
+            }
+            if (mConferenceParticipants.isEmpty()) {
+                return new ArrayList<ConferenceParticipant>(0);
+            }
             return new ArrayList<ConferenceParticipant>(mConferenceParticipants);
         }
     }