@@ -45,7 +45,7 @@ - (instancetype)initWithChannel:(FLEMethodChannel *)channel {
45
45
* panel channel.
46
46
*/
47
47
- (void )handleMethodCall : (FLEMethodCall *)call result : (FLEMethodResult)result {
48
- BOOL methodImplemented = YES ;
48
+ id methodResult = nil ;
49
49
if ([call.methodName isEqualToString: @(plugins_color_panel: :kShowColorPanelMethod )]) {
50
50
if ([call.arguments isKindOfClass: [NSDictionary class ]]) {
51
51
BOOL showAlpha =
@@ -56,19 +56,18 @@ - (void)handleMethodCall:(FLEMethodCall *)call result:(FLEMethodResult)result {
56
56
[NSString stringWithFormat: @" Malformed call for %@ . Expected an NSDictionary but got %@ " ,
57
57
@(plugins_color_panel: :kShowColorPanelMethod ),
58
58
NSStringFromClass ([call.arguments class ])];
59
- result ([[FLEMethodError alloc ] initWithCode: @" error"
60
- message: @" Bad arguments"
61
- details: errorString]);
62
- return ;
59
+ methodResult = [[FLEMethodError alloc ] initWithCode: @" Bad arguments"
60
+ message: errorString
61
+ details: nil ];
63
62
}
64
63
} else if ([call.methodName isEqualToString: @(plugins_color_panel: :kHideColorPanelMethod )]) {
65
64
[self hideColorPanel ];
66
65
} else {
67
- methodImplemented = NO ;
66
+ methodResult = FLEMethodNotImplemented ;
68
67
}
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 );
68
+ // If no errors are generated, send an immediate empty success message for handled messages, since
69
+ // the actual color data will be provided in follow-up messages.
70
+ result (methodResult );
72
71
}
73
72
74
73
/* *
0 commit comments