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

Commit f25a6830 authored by Jakob Schneider's avatar Jakob Schneider
Browse files

Fix a NPE in PIA if the caller has no requested permissions.

Test: tested manually
Change-Id: I2bf0d7b0d194aa0e8091fe07558ffade863a9ab9
parent 922a3212
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import android.os.Bundle;
import android.os.Process;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.annotation.NonNull;

import java.io.IOException;
import java.util.Arrays;
@@ -105,7 +105,7 @@ public class UnarchiveActivity extends Activity {
        }
    }

    @Nullable
    @NonNull
    private String[] getRequestedPermissions(String callingPackage) {
        String[] requestedPermissions = null;
        try {
@@ -115,7 +115,7 @@ public class UnarchiveActivity extends Activity {
            // Should be unreachable because we've just fetched the packageName above.
            Log.e(TAG, "Package not found for " + callingPackage);
        }
        return requestedPermissions;
        return requestedPermissions == null ? new String[]{} : requestedPermissions;
    }

    void startUnarchive() {