@@ -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,19 @@ - (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]) ;
59
+ methodResult = [[FLEMethodError alloc ] initWithCode: @" Bad arguments "
60
+ message: errorString
61
+ details: nil ] ;
62
62
return ;
63
63
}
64
64
} else if ([call.methodName isEqualToString: @(plugins_color_panel: :kHideColorPanelMethod )]) {
65
65
[self hideColorPanel ];
66
66
} else {
67
- methodImplemented = NO ;
67
+ methodResult = FLEMethodNotImplemented ;
68
68
}
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 );
72
72
}
73
73
74
74
/* *
0 commit comments