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

Commit c258a3dd authored by Sudheer Shanka's avatar Sudheer Shanka Committed by android-build-merger
Browse files

Fix NullPointerException in Utils.copyMeProfilePhoto.

am: 39975a60

* commit '39975a60':
  Fix NullPointerException in Utils.copyMeProfilePhoto.

Change-Id: I3fb15ca1afb2f0887767ee9a63314d19c1642eb0
parents 5a9cff70 39975a60
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) { }