diff --git a/IRCCloud/Classes/EventsDataSource.m b/IRCCloud/Classes/EventsDataSource.m index 94d24204..ee9c0264 100644 --- a/IRCCloud/Classes/EventsDataSource.m +++ b/IRCCloud/Classes/EventsDataSource.m @@ -30,6 +30,11 @@ @implementation Event + (BOOL)supportsSecureCoding { return YES; } +-(instancetype)init { + self = [super init]; + self->_type = (NSString *)[[NSNull alloc] init]; + return self; +} -(NSComparisonResult)compare:(Event *)aEvent { if(aEvent.pending && !_pending) return NSOrderedAscending; @@ -57,7 +62,7 @@ -(BOOL)isImportant:(NSString *)bufferType { if(!from.length) from = self->_nick; - if([ignore match:[NSString stringWithFormat:@"%@!%@",from,self->_hostmask]]) + if(from != nil && self->_hostmask != nil && [ignore match:[NSString stringWithFormat:@"%@!%@",from,self->_hostmask]]) return NO; } diff --git a/IRCCloud/Classes/MainViewController.m b/IRCCloud/Classes/MainViewController.m index c987b01d..e84d2fe2 100644 --- a/IRCCloud/Classes/MainViewController.m +++ b/IRCCloud/Classes/MainViewController.m @@ -5473,7 +5473,10 @@ -(void)paste:(id)sender { if([UIPasteboard generalPasteboard].hasImages && ![UIPasteboard generalPasteboard].hasURLs) { for(NSString *type in [UIPasteboard generalPasteboard].pasteboardTypes) { if([type isEqualToString:(__bridge NSString *)kUTTypeGIF] && [UIPasteboard generalPasteboard].image) { - [self _imagePickerController:[UIImagePickerController new] didFinishPickingMediaWithInfo:@{UIImagePickerControllerOriginalImage:[UIPasteboard generalPasteboard].image, @"gifData":[[UIPasteboard generalPasteboard] dataForPasteboardType:(__bridge NSString *)kUTTypeGIF]}]; + UIImage *img = [UIPasteboard generalPasteboard].image; + NSData *gifData = [[UIPasteboard generalPasteboard] dataForPasteboardType:(__bridge NSString *)kUTTypeGIF]; + if(img != nil && gifData != nil) + [self _imagePickerController:[UIImagePickerController new] didFinishPickingMediaWithInfo:@{UIImagePickerControllerOriginalImage:img, @"gifData":gifData}]; return; } } diff --git a/IRCCloud/Classes/NetworkConnection.m b/IRCCloud/Classes/NetworkConnection.m index 07e8ff43..3e0f1ca5 100644 --- a/IRCCloud/Classes/NetworkConnection.m +++ b/IRCCloud/Classes/NetworkConnection.m @@ -2135,7 +2135,7 @@ -(void)clearPrefs { } -(void)webSocketDidOpen:(WebSocket *)socket { - if(socket == self->_socket) { + if(socket == self->_socket && self.session != nil) { CLS_LOG(@"Socket connected"); self->_idleInterval = 20; self->_reconnectTimestamp = -1; diff --git a/ShareExtension/ShareViewController.m b/ShareExtension/ShareViewController.m index c9a41696..ae65b7b0 100644 --- a/ShareExtension/ShareViewController.m +++ b/ShareExtension/ShareViewController.m @@ -222,6 +222,10 @@ - (void)didSelectPost { NSExtensionItem *output = [input copy]; output.attributedContentText = [[NSAttributedString alloc] initWithString:self.contentText attributes:nil]; + if(self->_buffer == nil || self->_buffer.name == nil) { + return; + } + if(output.attachments.count) { if(self->_fileUploader.originalFilename) { NSLog(@"Setting filename, bid, and message for IRCCloud upload"); diff --git a/build-scripts/BUILD b/build-scripts/BUILD index cfd6ea5a..ef491079 100644 --- a/build-scripts/BUILD +++ b/build-scripts/BUILD @@ -1 +1 @@ -335 \ No newline at end of file +337 \ No newline at end of file