We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f73e25e commit aaa2d7fCopy full SHA for aaa2d7f
app/src/main/java/com/futo/platformplayer/states/StateAssets.kt
@@ -1,6 +1,7 @@
1
package com.futo.platformplayer.states
2
3
import android.content.Context
4
+import com.futo.platformplayer.logging.Logger
5
import kotlin.streams.asSequence
6
7
/***
@@ -45,10 +46,16 @@ class StateAssets {
45
46
var text: String?;
47
synchronized(_cache) {
48
if (!_cache.containsKey(path)) {
- text = context.assets
49
- ?.open(path)
50
- ?.bufferedReader()
51
- ?.use { it.readText(); };
+ try {
+ text = context.assets
+ ?.open(path)
52
+ ?.bufferedReader()
53
+ ?.use { it.readText(); };
54
+ }
55
+ catch(ex: Throwable) {
56
+ Logger.e("StateAssets", "Could not open asset: " + path, ex);
57
+ return null;
58
59
60
_cache.put(path, text);
61
} else {
0 commit comments