Skip to content

Commit

Permalink
[bug] Fix crash in Android Navigator: #412
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Dec 20, 2023
1 parent c7d14c1 commit 4064abb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission
android:requiredFeature="@string/ark_file_picker_pick"
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ class TagLabeledNStorage(
override suspend fun init() {
val storage = locateStorage()
if (storage?.exists() == true) {
val json = Json.decodeFromStream<JsonTagLabeledN>(storage.inputStream())
tagLabeledAmount.putAll(json.data)
try {
val json = Json.decodeFromStream<JsonTagLabeledN>(
storage.inputStream()
)
tagLabeledAmount.putAll(json.data)
} catch (exception: Exception) {
Timber.e("TagLabeledNStorage.init exception: " + exception.message)
}
} else {
index.allIds()
.associateWith { tagsStorage.getTags(it) }
Expand Down

0 comments on commit 4064abb

Please sign in to comment.