-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
image_compression_flutter/lib/src/interface.dart
Lines 13 to 30 in fb9880f
| @protected | |
| Future dummyCallNativeCode( | |
| String method, | |
| Map<String, dynamic> data, | |
| Future<ic.ImageFile> Function() callback, | |
| ) async { | |
| try { | |
| // Invoke will work only on Web, otherwise it will execute callback | |
| final result = await _channel.invokeMethod(method, data); | |
| if (result is Map) { | |
| return ImageFileExtension.decode(result); | |
| } | |
| return null; | |
| } on MissingPluginException catch (_) { | |
| return await callback(); | |
| } | |
| } |
This method should not return null. It currently returns null if result is not a Map, but none of the other places that use this method expect null and will unexpectedly throw if they receive null.
Here is a list of all the places that call dummyCallNativeCode but do not handle receiving null:
| return await dummyCallNativeCode( |
| return await dummyCallNativeCode( |
| return await dummyCallNativeCode( |
| return await dummyCallNativeCode( |
| return await dummyCallNativeCode( |
Metadata
Metadata
Assignees
Labels
No labels