Skip to content

Commit

Permalink
fix(storage): add null check to updateMetadata(...) on Android (#580
Browse files Browse the repository at this point in the history
)
  • Loading branch information
robingenz committed Mar 9, 2024
1 parent 506e930 commit 59fd3d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-ants-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/storage': patch
---

fix(android): add `null` check to `updateMetadata(...)`
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class FirebaseStoragePlugin extends Plugin {
public static final String TAG = "FirebaseStorage";
public static final String ERROR_PATH_MISSING = "path must be provided.";
public static final String ERROR_URI_MISSING = "uri must be provided.";
public static final String ERROR_METADATA_MISSING = "metadata must be provided.";

private FirebaseStorage implementation;

Expand Down Expand Up @@ -161,6 +162,10 @@ public void updateMetadata(PluginCall call) {
return;
}
JSObject metadata = call.getObject("metadata");
if (metadata == null) {
call.reject(ERROR_METADATA_MISSING);
return;
}

UpdateMetadataOptions options = new UpdateMetadataOptions(path, metadata);
EmptyResultCallback callback = new EmptyResultCallback() {
Expand Down

0 comments on commit 59fd3d0

Please sign in to comment.