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

Commit 39975a60 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Fix NullPointerException in Utils.copyMeProfilePhoto.

Bug: 28221898
Change-Id: I2f67c4ba349a1c831b22174fefd0db6efeffbf1e
parent 7f4892f2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -347,11 +347,12 @@ public final class Utils extends com.android.settingslib.Utils {
        // If there's no profile photo, assign a default avatar
        if (avatarDataStream == null) {
            assignDefaultPhoto(context, userId);
        } else {
            return;
        }

        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
        Bitmap icon = BitmapFactory.decodeStream(avatarDataStream);
        um.setUserIcon(userId, icon);
        }
        try {
            avatarDataStream.close();
        } catch (IOException ioe) { }