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

Commit 6f6154bf 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
parent 93e87cf1
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -312,7 +312,9 @@ public class VolumeInfo implements Parcelable {
     * {@link android.Manifest.permission#WRITE_MEDIA_STORAGE}.
     * {@link android.Manifest.permission#WRITE_MEDIA_STORAGE}.
     */
     */
    public File getInternalPathForUser(int userId) {
    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
            // TODO: plumb through cleaner path from vold
            return new File(path.replace("/storage/", "/mnt/media_rw/"));
            return new File(path.replace("/storage/", "/mnt/media_rw/"));
        } else {
        } else {