Skip to content

Commit 13041ef

Browse files
authored
Merge pull request #213 from friedjoff/master
Fix upload for empty url string
2 parents 6668b36 + 854c336 commit 13041ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/io/fullstack/firestack/FirestackStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void onFailure(@NonNull Exception exception) {
146146
public void uploadFile(final String urlStr, final String name, final String filepath, final ReadableMap metadata, final Callback callback) {
147147
FirebaseStorage storage = FirebaseStorage.getInstance();
148148

149-
StorageReference storageRef = storage.getReferenceFromUrl(urlStr);
149+
StorageReference storageRef = urlStr!=null ? storage.getReferenceFromUrl(urlStr) : storage.getReference();
150150
StorageReference fileRef = storageRef.child(name);
151151

152152
Log.i(TAG, "From file: " + filepath + " to " + urlStr + " with name " + name);

0 commit comments

Comments
 (0)