Fix NullPointerException in Utils.copyMeProfilePhoto.
Bug: 28221898 Change-Id: I2f67c4ba349a1c831b22174fefd0db6efeffbf1e
This commit is contained in:
@@ -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) { }
|
||||
|
Reference in New Issue
Block a user