Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #69 from aclev/authenticationViewControllerFixes
Browse files Browse the repository at this point in the history
use firstObject on the childViewControllers aray instead of indexing by
  • Loading branch information
aclev committed Dec 10, 2015
2 parents a89f45a + 9de8bd4 commit 9311d34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OneDriveSDK/Auth/ODBaseAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (instancetype)initWithServiceInfo:(ODServiceInfo *)serviceInfo
- (void) authenticateWithViewController:(UIViewController *)viewController completion:(void (^)(NSError *error))completionHandler;
{
// Get the view controller on the top of the stack
UIViewController *presentingViewController = [viewController childViewControllers][0];
UIViewController *presentingViewController = [[viewController childViewControllers] firstObject];
// if the view controller's child is an ODAuthenticationViewController we just want to redirect to a new URL
// not push another view controller
if (presentingViewController && [presentingViewController respondsToSelector:@selector(redirectWithStartURL:endURL:success:)]){
Expand Down
2 changes: 1 addition & 1 deletion OneDriveSDK/Auth/ODBusinessAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void) authenticateWithViewController:(UIViewController*)viewController comple
self.authContext.parentController = viewController;
// If the disambiguation page is still being displayed remove it from the view
if (self.authContext.parentController){
UIViewController *childViewController = [viewController childViewControllers][0];
UIViewController *childViewController = [[viewController childViewControllers] firstObject];
if (childViewController && [childViewController respondsToSelector:@selector(redirectWithStartURL:endURL:success:)]){
self.authContext.parentController = viewController.presentingViewController;
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down

0 comments on commit 9311d34

Please sign in to comment.