Fix NullPointerException in Utils.copyMeProfilePhoto.
am: 39975a6
* commit '39975a60cc0953da058bbfa33c16007f763f5498':
Fix NullPointerException in Utils.copyMeProfilePhoto.
Change-Id: I3fb15ca1afb2f0887767ee9a63314d19c1642eb0
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 {
|
||||
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
Bitmap icon = BitmapFactory.decodeStream(avatarDataStream);
|
||||
um.setUserIcon(userId, icon);
|
||||
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