Permalink
Browse files

Don't display a dialog if the user didn't pick a place from the place…

… picker.

Summary: Don't display a dialog if the user didn't pick a place.

Test Plan:
Click done in the place picker both with a place picked and without to see
if any problems crop up.

Click cancel in the place picker to make sure that it still dismisses the
dialog.

Reviewers: jacl

Reviewed By: jacl

CC: mmachedon

Differential Revision: https://phabricator.fb.com/D576940

Task ID: 1407166
  • Loading branch information...
1 parent 7f62269 commit 0f14c8ea559ed3c1e318bff3916dc180c937e52c @chrisblizzard chrisblizzard committed with onebit Sep 18, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 samples/HelloFacebookSample/HelloFacebookSample/HFViewController.m
@@ -254,9 +254,14 @@ - (IBAction)pickPlaceClick:(UIButton *)sender {
if (!donePressed) {
return;
}
-
- [[[UIAlertView alloc] initWithTitle:@"You Picked:"
- message:placePickerController.selection.name
+
+ NSString *placeName = placePickerController.selection.name;
+ if (!placeName) {
+ placeName = @"<No Place Selected>";
+ }
+
+ [[[UIAlertView alloc] initWithTitle:@"You Picked:"
+ message:placeName
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil]

0 comments on commit 0f14c8e

Please sign in to comment.