From f6502c316c602e44fd5a1706013d7123a9eb1022 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 14 Oct 2013 14:09:21 -0700 Subject: [PATCH] Don't crash if WallpaperCropActivity isn't passed a URI Bug: 11173560 --- src/com/android/launcher3/WallpaperCropActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/WallpaperCropActivity.java b/src/com/android/launcher3/WallpaperCropActivity.java index 79cc88ef9..30ec340b1 100644 --- a/src/com/android/launcher3/WallpaperCropActivity.java +++ b/src/com/android/launcher3/WallpaperCropActivity.java @@ -87,9 +87,15 @@ public class WallpaperCropActivity extends Activity { mCropView = (CropView) findViewById(R.id.cropView); - Intent cropIntent = this.getIntent(); + Intent cropIntent = getIntent(); final Uri imageUri = cropIntent.getData(); + if (imageUri == null) { + Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity"); + finish(); + return; + } + int rotation = getRotationFromExif(this, imageUri); mCropView.setTileSource(new BitmapRegionTileSource(this, imageUri, 1024, rotation), null); mCropView.setTouchEnabled(true); -- 2.11.0