Skip to content

Commit

Permalink
Check varialbe exists before call dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
nasli committed Jan 25, 2018
1 parent fd00a83 commit 8e92708
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Owncloud iOs Client/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ - (void) closeAlertViewAndViewControllers {

if (self.presentFilesViewController){
//Close the openWith option in FileViewController
if (self.presentFilesViewController.openWith) {
if (self.presentFilesViewController.openWith && self.presentFilesViewController.openWith.documentInteractionController) {
[self.presentFilesViewController.openWith.documentInteractionController dismissMenuAnimated:NO];
self.presentFilesViewController.openWith.documentInteractionController = nil;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,10 @@ - (void)presentWhiteView {
self.view.backgroundColor = [UIColor colorOfBackgroundDetailViewiPad];

_titleLabel.text = @"";

[_openWith.documentInteractionController dismissMenuAnimated:YES];

if (_openWith && _openWith.documentInteractionController) {
[_openWith.documentInteractionController dismissMenuAnimated:YES];
}

[self removeThePreviousViews];

_isFileCharged = NO;
Expand Down Expand Up @@ -1734,8 +1735,7 @@ - (void) customWillRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterf
[self.readerPDFViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}

if (_openWith) {

if (_openWith && _openWith.documentInteractionController) {
[_openWith.documentInteractionController dismissMenuAnimated:NO];
}

Expand Down
2 changes: 1 addition & 1 deletion Owncloud iOs Client/Tabs/FileTab/FilesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ - (BOOL)shouldAutorotate {

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{

if (self.openWith && !IS_IPHONE) {
if (self.openWith && self.openWith.documentInteractionController && !IS_IPHONE) {
[self.openWith.documentInteractionController dismissMenuAnimated:NO];
}

Expand Down

0 comments on commit 8e92708

Please sign in to comment.