Fix NPE in TaskSnapshotController

Test: Pray
Change-Id: Ie65f072b35fbf1a9a65caf5be48dabbb7abb6be8
Fixes: 36592724
This commit is contained in:
Jorim Jaggi
2017-04-11 15:50:19 -07:00
parent 3f1febbedb
commit dd5986e035

View File

@@ -162,12 +162,15 @@ class TaskSnapshotController {
if (top == null) {
return null;
}
final WindowState mainWindow = top.findMainWindow();
if (mainWindow == null) {
return null;
}
final GraphicBuffer buffer = top.mDisplayContent.screenshotApplicationsToBuffer(top.token,
-1, -1, false, 1.0f, false, true);
if (buffer == null) {
return null;
}
final WindowState mainWindow = top.findMainWindow();
return new TaskSnapshot(buffer, top.getConfiguration().orientation,
minRect(mainWindow.mContentInsets, mainWindow.mStableInsets), false /* reduced */,
1f /* scale */);