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

Commit 30f63cf1 authored by Jerry Zhang's avatar Jerry Zhang
Browse files

Check for null path in getInternalPathForUser

In some situations, path could be null resulting
in a crash.

Test: no crash
Bug: 109730998
Change-Id: I2ce0410162d1327905d690331f461f9187e20906
(cherry picked from commit 6f6154bf)
parent 1f392c46
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -318,7 +318,9 @@ public class VolumeInfo implements Parcelable {
     * {@link android.Manifest.permission#WRITE_MEDIA_STORAGE}.
     */
    public File getInternalPathForUser(int userId) {
        if (type == TYPE_PUBLIC) {
        if (path == null) {
            return null;
        } else if (type == TYPE_PUBLIC) {
            // TODO: plumb through cleaner path from vold
            return new File(path.replace("/storage/", "/mnt/media_rw/"));
        } else {