New media scanner: only use with valid path
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
4f38a46846
commit
b01fdbab1b
|
@ -1718,7 +1718,7 @@ public class FileDataStorageManager {
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
ContentResolver contentResolver = MainApp.getAppContext().getContentResolver();
|
ContentResolver contentResolver = MainApp.getAppContext().getContentResolver();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && !TextUtils.isEmpty(path)) {
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
values.put(MediaStore.Images.Media.MIME_TYPE, file.getMimeType());
|
values.put(MediaStore.Images.Media.MIME_TYPE, file.getMimeType());
|
||||||
values.put(MediaStore.Images.Media.TITLE, file.getFileName());
|
values.put(MediaStore.Images.Media.TITLE, file.getFileName());
|
||||||
|
|
Loading…
Reference in New Issue