Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 2a44e8d

Browse files
committed
Fix[file_provider]: check for storage before initializing
1 parent 0972825 commit 2a44e8d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/scoped/FolderProvider.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class FolderProvider extends DocumentsProvider {
4747

4848
private static final String ALL_MIME_TYPES = "*/*";
4949

50-
private static final File BASE_DIR = new File(Tools.DIR_GAME_HOME);
50+
private File BASE_DIR;
5151

5252
private ContentResolver mContentResolver;
5353

@@ -138,6 +138,12 @@ public AssetFileDescriptor openDocumentThumbnail(String documentId, Point sizeHi
138138

139139
@Override
140140
public boolean onCreate() {
141+
if(Tools.checkStorageRoot(getContext())) {
142+
Tools.initStorageConstants(getContext());
143+
}else {
144+
return false;
145+
}
146+
BASE_DIR = new File(Tools.DIR_GAME_HOME);
141147
mContentResolver = getContext().getContentResolver();
142148
mStorageProviderAuthortiy = getContext().getString(R.string.storageProviderAuthorities);
143149
return true;

0 commit comments

Comments
 (0)