fixed a crash when sharing a story from the social feed that wasn't

shared by a friend (and set the source user to the non-friend who shared
it, if possible)
This commit is contained in:
vpatil 2013-09-28 18:12:46 -07:00
parent 9a52f7015a
commit 7e808bd7d8

View file

@ -338,9 +338,10 @@
}
if (appDelegate.isSocialRiverView) {
if ([appDelegate.activeStory objectForKey:@"friend_user_ids"] != nil) {
NSString *sourceUserIdStr = [NSString stringWithFormat:@"%@", [[appDelegate.activeStory objectForKey:@"friend_user_ids"] objectAtIndex:0]];
[request setPostValue:sourceUserIdStr forKey:@"source_user_id"];
if ([[appDelegate.activeStory objectForKey:@"friend_user_ids"] count] > 0) {
[request setPostValue:[NSString stringWithFormat:@"%@", [appDelegate.activeStory objectForKey:@"friend_user_ids"][0]] forKey:@"source_user_id"];
} else if ([[appDelegate.activeStory objectForKey:@"public_user_ids"] count] > 0) {
[request setPostValue:[NSString stringWithFormat:@"%@", [appDelegate.activeStory objectForKey:@"public_user_ids"][0]] forKey:@"source_user_id"];
}
} else {
if ([appDelegate.activeStory objectForKey:@"social_user_id"] != nil) {