mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-10-31 23:54:05 +00:00
Fix that old sticker, with an empty sticker set id caused a crash
This commit is contained in:
parent
223a0fdde3
commit
9c1f495782
@ -63,7 +63,11 @@ class StickerFileManager(message: JsonObject, file_base: String) : DocumentFileM
|
||||
|
||||
private val filenameBase: String
|
||||
get() {
|
||||
val set = sticker["stickerset"].obj.get("shortName").nullString ?: sticker["stickerset"].obj.get("id").string
|
||||
val stickerSet = sticker["stickerset"].obj
|
||||
val set = stickerSet.get("shortName").nullString
|
||||
?: stickerSet.get("id").nullString
|
||||
?: stickerSet.get("_constructor").nullString
|
||||
?: error("could not get a good name from: ${sticker["stickerset"]}")
|
||||
val hash = sticker["alt"].string.hashCode()
|
||||
return "${set}_${hash}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user