File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
android/src/main/java/io/fullstack/firestack/storage Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ public void downloadFile(final String urlStr,
111111 @ Override
112112 public void doInBackground (StreamDownloadTask .TaskSnapshot taskSnapshot , InputStream inputStream ) throws IOException {
113113 int indexOfLastSlash = localFile .lastIndexOf ("/" );
114- String pathMinusFileName = localFile .substring (0 , indexOfLastSlash ) + "/" ;
115- String filename = localFile .substring (indexOfLastSlash + 1 ) ;
114+ String pathMinusFileName = indexOfLastSlash > 0 ? localFile .substring (0 , indexOfLastSlash ) + "/" : "/" ;
115+ String filename = indexOfLastSlash > 0 ? localFile .substring (indexOfLastSlash + 1 ) : localFile ;
116116 File fileWithJustPath = new File (pathMinusFileName );
117117 if (!fileWithJustPath .mkdirs ()) {
118118 Log .e (TAG , "Directory not created" );
You can’t perform that action at this time.
0 commit comments