1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-23 01:06:17 +00:00

Fix that old sticker, with an empty sticker set id caused a crash

This commit is contained in:
Hannes 2018-05-13 12:56:31 +02:00
parent 223a0fdde3
commit 9c1f495782
No known key found for this signature in database
GPG Key ID: 0DEE6AD1C8EDBD87

View File

@ -63,7 +63,11 @@ class StickerFileManager(message: JsonObject, file_base: String) : DocumentFileM
private val filenameBase: String private val filenameBase: String
get() { 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() val hash = sticker["alt"].string.hashCode()
return "${set}_${hash}" return "${set}_${hash}"
} }