Skip to content

Commit 6c13503

Browse files
Address review comments
1 parent 2354f98 commit 6c13503

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

plugins/color_panel/macos/FLEColorPanelPlugin.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ - (instancetype)initWithChannel:(FLEMethodChannel *)channel {
4545
* panel channel.
4646
*/
4747
- (void)handleMethodCall:(FLEMethodCall *)call result:(FLEMethodResult)result {
48-
BOOL methodImplemented = YES;
48+
id methodResult = nil;
4949
if ([call.methodName isEqualToString:@(plugins_color_panel::kShowColorPanelMethod)]) {
5050
if ([call.arguments isKindOfClass:[NSDictionary class]]) {
5151
BOOL showAlpha =
@@ -56,19 +56,19 @@ - (void)handleMethodCall:(FLEMethodCall *)call result:(FLEMethodResult)result {
5656
[NSString stringWithFormat:@"Malformed call for %@. Expected an NSDictionary but got %@",
5757
@(plugins_color_panel::kShowColorPanelMethod),
5858
NSStringFromClass([call.arguments class])];
59-
result([[FLEMethodError alloc] initWithCode:@"error"
60-
message:@"Bad arguments"
61-
details:errorString]);
59+
methodResult = [[FLEMethodError alloc] initWithCode:@"Bad arguments"
60+
message:errorString
61+
details:nil];
6262
return;
6363
}
6464
} else if ([call.methodName isEqualToString:@(plugins_color_panel::kHideColorPanelMethod)]) {
6565
[self hideColorPanel];
6666
} else {
67-
methodImplemented = NO;
67+
methodResult = FLEMethodNotImplemented;
6868
}
69-
// Send an immediate empty success message for handled messages, since the actual color data
70-
// will be provided in follow-up messages.
71-
result(methodImplemented ? nil : FLEMethodNotImplemented);
69+
// If no errors are generated, send an immediate empty success message for handled messages, since
70+
// the actual color data will be provided in follow-up messages.
71+
result(methodResult);
7272
}
7373

7474
/**

0 commit comments

Comments
 (0)