From 8dd559b825030d29b30b32b353a08dcc13dc42b7 Mon Sep 17 00:00:00 2001 From: Ellet Date: Thu, 17 Oct 2024 08:12:45 +0300 Subject: [PATCH] fix: avoid using getClipboardFiles() if unsupported on the current platform --- .../clipboard/default_clipboard_service.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart b/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart index 21db10cdd..6ce39da24 100644 --- a/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart +++ b/lib/src/editor_toolbar_controller_shared/clipboard/default_clipboard_service.dart @@ -48,6 +48,10 @@ class DefaultClipboardService extends ClipboardService { } Future _getClipboardFile({required String fileExtension}) async { + if (!(await QuillNativeBridge.isSupported( + QuillNativeBridgeFeature.getClipboardFiles))) { + return null; + } if (kIsWeb) { // TODO: Can't read file with dart:io on the Web (See related https://github.com/FlutterQuill/quill-native-bridge/issues/6) return null;