Sharesheet - Fix NPE on default app launch

Turns out there's a secondary layout used by resolver which does not
contain R.id.empty. Check for null.

Bug: 133707284
Test: Open PDF file through resolver
Change-Id: I311f1c1d2fa6edcebc81d9056755884b1585a7cb
This commit is contained in:
Matt Pietal
2019-05-29 07:39:21 -04:00
parent 2cf040d602
commit 32922ca4db

View File

@@ -383,9 +383,11 @@ public class ResolverActivity extends Activity {
mSystemWindowInsets.right, 0);
View emptyView = findViewById(R.id.empty);
emptyView.setPadding(0, 0, 0, mSystemWindowInsets.bottom
+ getResources().getDimensionPixelSize(
R.dimen.chooser_edge_margin_normal) * 2);
if (emptyView != null) {
emptyView.setPadding(0, 0, 0, mSystemWindowInsets.bottom
+ getResources().getDimensionPixelSize(
R.dimen.chooser_edge_margin_normal) * 2);
}
if (mFooterSpacer == null) {
mFooterSpacer = new Space(getApplicationContext());