Skip to content

Commit

Permalink
Fix crashes that could occur when reacting to or unsending multipart …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
tneotia committed Dec 27, 2022
1 parent 6b42522 commit 9799e8f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEPLOYMENT_LOCATION = YES;
DEVELOPMENT_TEAM = S6D73TBQQU;
DSTROOT = /;
Expand All @@ -483,7 +483,7 @@
INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins";
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.0.8;
MARKETING_VERSION = 0.0.9;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.bluebubbles.messaging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -504,7 +504,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEPLOYMENT_LOCATION = YES;
DEVELOPMENT_TEAM = S6D73TBQQU;
DSTROOT = /;
Expand All @@ -519,7 +519,7 @@
INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins";
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.0.8;
MARKETING_VERSION = 0.0.9;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.bluebubbles.messaging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Binary file not shown.
14 changes: 12 additions & 2 deletions MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,12 @@ -(void) handleMessage: (NetworkController*)controller message:(NSString *)messa
IMMessagePartChatItem *item;
// sometimes items is an array so we need to account for that
if ([items isKindOfClass:[NSArray class]]) {
item = [(NSArray *)items objectAtIndex:([data[@"partIndex"] integerValue])];
for (IMMessagePartChatItem *i in (NSArray *) items) {
if ([i index] == [data[@"partIndex"] integerValue]) {
item = i;
break;
}
}
} else {
item = (IMMessagePartChatItem *)items;
}
Expand Down Expand Up @@ -520,7 +525,12 @@ +(void) sendMessage: (NSDictionary *) data transaction:(NSString *) transaction
IMMessagePartChatItem *item;
// sometimes items is an array so we need to account for that
if ([items isKindOfClass:[NSArray class]]) {
item = [(NSArray *)items objectAtIndex:([data[@"partIndex"] integerValue])];
for (IMMessagePartChatItem *i in (NSArray *) items) {
if ([i index] == [data[@"partIndex"] integerValue]) {
item = i;
break;
}
}
} else {
item = (IMMessagePartChatItem *)items;
}
Expand Down

0 comments on commit 9799e8f

Please sign in to comment.