Prevent empty file name

This commit is contained in:
M66B 2020-04-28 07:57:35 +02:00
parent 6a2477b94d
commit c1078a91d8
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,9 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
if (TextUtils.isEmpty(fname)) if (TextUtils.isEmpty(fname))
fname = uri.getLastPathSegment(); fname = uri.getLastPathSegment();
if (TextUtils.isEmpty(fname))
return uri;
File dir = new File(getCacheDir(), "shared"); File dir = new File(getCacheDir(), "shared");
if (!dir.exists()) if (!dir.exists())
dir.mkdir(); dir.mkdir();