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

Commit 90157bba authored by Jerry Zhang's avatar Jerry Zhang Committed by Po-Chien Hsueh
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
Merged-In: I2ce0410162d1327905d690331f461f9187e20906
(cherry picked from commit 6f6154bf)
(cherry picked from commit 30f63cf1)
parent 6549309f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -312,7 +312,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 {