diff --git a/NextcloudTalk/NCCameraController.swift b/NextcloudTalk/NCCameraController.swift index 28ae15b81..709bcd5b6 100644 --- a/NextcloudTalk/NCCameraController.swift +++ b/NextcloudTalk/NCCameraController.swift @@ -220,9 +220,9 @@ class NCCameraController: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate self.session?.sessionPreset = .inputPriority if self.usingFrontCamera { - self.session?.addInput(getFrontCameraInput()) + self.session?.addInput(self.getFrontCameraInput()) } else { - self.session?.addInput(getBackCameraInput()) + self.session?.addInput(self.getBackCameraInput()) } let output = AVCaptureVideoDataOutput() diff --git a/NextcloudTalk/RoomsTableViewController.m b/NextcloudTalk/RoomsTableViewController.m index 4b2517c2e..309c3115c 100644 --- a/NextcloudTalk/RoomsTableViewController.m +++ b/NextcloudTalk/RoomsTableViewController.m @@ -439,21 +439,24 @@ - (void)updateAccountPickerMenu for (TalkAccount *account in [[NCDatabaseManager sharedInstance] allAccounts]) { NSString *accountName = account.userDisplayName; UIImage *accountImage = [[NCAPIController sharedInstance] userProfileImageForAccount:account withStyle:self.traitCollection.userInterfaceStyle]; - accountImage = [NCUtils roundedImageFromImage:accountImage]; - // Draw a red circle to the image in case we have unread notifications for that account - if (account.unreadNotification) { - UIGraphicsBeginImageContextWithOptions(CGSizeMake(82, 82), NO, 3); - CGContextRef context = UIGraphicsGetCurrentContext(); - [accountImage drawInRect:CGRectMake(0, 4, 78, 78)]; - CGContextSaveGState(context); + if (accountImage) { + accountImage = [NCUtils roundedImageFromImage:accountImage]; - CGContextSetFillColorWithColor(context, [UIColor systemRedColor].CGColor); - CGContextFillEllipseInRect(context, CGRectMake(52, 0, 30, 30)); + // Draw a red circle to the image in case we have unread notifications for that account + if (account.unreadNotification) { + UIGraphicsBeginImageContextWithOptions(CGSizeMake(82, 82), NO, 3); + CGContextRef context = UIGraphicsGetCurrentContext(); + [accountImage drawInRect:CGRectMake(0, 4, 78, 78)]; + CGContextSaveGState(context); - accountImage = UIGraphicsGetImageFromCurrentImageContext(); + CGContextSetFillColorWithColor(context, [UIColor systemRedColor].CGColor); + CGContextFillEllipseInRect(context, CGRectMake(52, 0, 30, 30)); - UIGraphicsEndImageContext(); + accountImage = UIGraphicsGetImageFromCurrentImageContext(); + + UIGraphicsEndImageContext(); + } } UIAction *switchAccountAction = [UIAction actionWithTitle:accountName image:accountImage identifier:nil handler:^(UIAction *action) {