diff --git a/app/src/main/java/com/limelight/AppView.java b/app/src/main/java/com/limelight/AppView.java index 5ad7c82e..2c923c48 100644 --- a/app/src/main/java/com/limelight/AppView.java +++ b/app/src/main/java/com/limelight/AppView.java @@ -345,10 +345,15 @@ public class AppView extends Activity implements AdapterFragmentCallbacks { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // Only add an option to create shortcut if box art is loaded + // and when we're in grid-mode (not list-mode). ImageView appImageView = info.targetView.findViewById(R.id.grid_image); - BitmapDrawable drawable = (BitmapDrawable)appImageView.getDrawable(); - if (drawable != null && drawable.getBitmap() != null) { - menu.add(Menu.NONE, CREATE_SHORTCUT_ID, 4, getResources().getString(R.string.applist_menu_scut)); + if (appImageView != null) { + // We have a grid ImageView, so we must be in grid-mode + BitmapDrawable drawable = (BitmapDrawable)appImageView.getDrawable(); + if (drawable != null && drawable.getBitmap() != null) { + // We have a bitmap loaded too + menu.add(Menu.NONE, CREATE_SHORTCUT_ID, 4, getResources().getString(R.string.applist_menu_scut)); + } } } }