Add a null check to prevent NPE
Rare case where the rect returned from a View is null. BUG: 28118236 Change-Id: Ie95b082c92c110f753152a50399c188b19d14e4b
This commit is contained in:
@@ -121,11 +121,13 @@ public class RecentsTvTransitionHelper {
|
||||
}
|
||||
try {
|
||||
Rect taskRect = taskView.getFocusedThumbnailRect();
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(task.thumbnail, taskRect.width(),
|
||||
taskRect.height(), false);
|
||||
WindowManagerGlobal.getWindowManagerService()
|
||||
.overridePendingAppTransitionAspectScaledThumb(thumbnail, taskRect.left,
|
||||
taskRect.top, taskRect.width(), taskRect.height(), callback, true);
|
||||
if (taskRect != null) {
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(task.thumbnail, taskRect.width(),
|
||||
taskRect.height(), false);
|
||||
WindowManagerGlobal.getWindowManagerService()
|
||||
.overridePendingAppTransitionAspectScaledThumb(thumbnail, taskRect.left,
|
||||
taskRect.top, taskRect.width(), taskRect.height(), callback, true);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Failed to override transition: " + e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user