From c9801fd3a66a535c885dea67466c58eb33e16770 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Tue, 26 Apr 2022 14:42:21 +0200 Subject: [PATCH] fix(filesystem): Prevent android crash on invalid base64 write --- .../com/capacitorjs/plugins/filesystem/FilesystemPlugin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filesystem/android/src/main/java/com/capacitorjs/plugins/filesystem/FilesystemPlugin.java b/filesystem/android/src/main/java/com/capacitorjs/plugins/filesystem/FilesystemPlugin.java index eef29742a..f3e8c3cbe 100644 --- a/filesystem/android/src/main/java/com/capacitorjs/plugins/filesystem/FilesystemPlugin.java +++ b/filesystem/android/src/main/java/com/capacitorjs/plugins/filesystem/FilesystemPlugin.java @@ -169,6 +169,8 @@ private void saveFile(PluginCall call, File file, String data) { ex ); call.reject("FILE_NOTCREATED"); + } catch (IllegalArgumentException ex) { + call.reject("The supplied data is not valid base64 content."); } }