Skip to content

Commit

Permalink
Don't crash if WallpaperCropActivity isn't passed a URI
Browse files Browse the repository at this point in the history
Bug: 11173560
  • Loading branch information
mikejurka committed Oct 14, 2013
1 parent decbaa6 commit f6502c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/android/launcher3/WallpaperCropActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ protected void init() {

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);
Expand Down

0 comments on commit f6502c3

Please sign in to comment.