This commit is contained in:
tarsin committed 2023-05-31 21:38:52 +08:00
1 parent 0eec51ef8e
commit 858134927a
2 files changed
+3 -4

No files matched your search

@@ -34,8 +34,8 @@ class FavouriteStatusRouter {
return id
}
fun restoreDataMap(id: Int): MutableMap<Long, GalleryInfo> {
return maps.remove(id)!!
fun restoreDataMap(id: Int): MutableMap<Long, GalleryInfo>? {
return maps.remove(id)
}
fun modifyFavourites(gid: Long, slot: Int) {
@@ -77,8 +77,7 @@ abstract class GalleryInfoContentHelper : ContentHelper() {
val id = bundle.getInt(KEY_DATA_MAP, IntIdGenerator.INVALID_ID)
if (id != IntIdGenerator.INVALID_ID) {
val router = EhApplication.favouriteStatusRouter
val map = router.restoreDataMap(id)
this.map = map
router.restoreDataMap(id)?.let { this.map = it }
}
return super.restoreInstanceState(state)
}