Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f281279 authored by Joe Onorato's avatar Joe Onorato
Browse files

Fix crash in incident report confirmation

Bug: 123955906
Test: atest GtsIncidentConfirmationTestCases
Change-Id: I6025f8bfdef64d2f7af04489efbe4cd59db5f510
parent 0d873b35
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ public class ConfirmationActivity extends Activity implements OnClickListener, O
        final Formatting formatting = new Formatting(this);

        final Uri uri = getIntent().getData();
        Log.d(TAG, "uri=" + uri);
        if (uri == null) {
            Log.w(TAG, "No uri in intent: " + getIntent());
            finish();
@@ -213,6 +214,12 @@ public class ConfirmationActivity extends Activity implements OnClickListener, O
        try {
            final IncidentManager incidentManager = getSystemService(IncidentManager.class);
            final IncidentManager.IncidentReport report = incidentManager.getIncidentReport(uri);
            if (report == null) {
                // There is no incident report, so no images to show, so return empty list.
                // Other errors below are invalid images, which we reject, because they're there
                // but we can't let  the user confirm it.
                return new ArrayList();
            }

            final InputStream stream = report.getInputStream();
            if (stream != null) {