Skip to content

Commit

Permalink
Fix a crash on iOS 12
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Apr 1, 2022
1 parent 74a734c commit 963f6a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions IRCCloud/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3684,7 +3684,9 @@ -(IBAction)settingsButtonPressed:(id)sender {
User *me = [[UsersDataSource sharedInstance] getUser:[[ServersDataSource sharedInstance] getServer:self->_buffer.cid].nick cid:self->_buffer.cid bid:self->_buffer.bid];

UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
if (@available(iOS 13, *)) {
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
}

void (^handler)(UIAlertAction *action) = ^(UIAlertAction *a) {
[self actionSheetActionClicked:a.title];
Expand Down Expand Up @@ -3888,7 +3890,9 @@ -(void)_showUserPopupInRect:(CGRect)rect {
title = self->_selectedUser.nick;
}
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet];
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
if (@available(iOS 13, *)) {
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
}

void (^handler)(UIAlertAction *action) = ^(UIAlertAction *a) {
[self actionSheetActionClicked:a.title];
Expand Down Expand Up @@ -4164,7 +4168,9 @@ -(void)bufferLongPressed:(int)bid rect:(CGRect)rect {
self->_selectedURL = nil;
self->_selectedBuffer = [[BuffersDataSource sharedInstance] getBuffer:bid];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
if (@available(iOS 13, *)) {
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
}
if([self->_selectedBuffer.type isEqualToString:@"console"]) {
Server *s = [[ServersDataSource sharedInstance] getServer:self->_selectedBuffer.cid];
if([s.status isEqualToString:@"disconnected"]) {
Expand Down Expand Up @@ -4846,7 +4852,9 @@ -(void)showUploads {

-(void)uploadsButtonPressed:(id)sender {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
if (@available(iOS 13, *)) {
alert.overrideUserInterfaceStyle = self.view.overrideUserInterfaceStyle;
}

BOOL isCatalyst = NO;
if (@available(iOS 13.0, *)) {
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
239
241

0 comments on commit 963f6a6

Please sign in to comment.