Fix NullPointerException in Utils.copyMeProfilePhoto. am: 39975a6
am: c258a3d
* commit 'c258a3dd4129eacc6a69847871b8f7bfa8a6e266':
Fix NullPointerException in Utils.copyMeProfilePhoto.
Change-Id: I179eb6365ff2ea9eb396160e179838f4276f2199
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