mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-22 16:56:16 +00:00
Kotlin: Fixed the bugs introduced by ResultSet#getString() being able to return NULL without Kotlin knowing about that.
This commit is contained in:
parent
9bc2ed7666
commit
7067f98943
@ -662,13 +662,13 @@ class Database private constructor(var client: TelegramClient) {
|
|||||||
abstract val query: String
|
abstract val query: String
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class Dialog(var id: Int, var first_name: String, var last_name: String, var username: String, var count: Int) : AbstractChat() {
|
inner class Dialog(var id: Int, var first_name: String?, var last_name: String?, var username: String?, var count: Int?) : AbstractChat() {
|
||||||
|
|
||||||
override val query: String
|
override val query: String
|
||||||
get() = "source_type='dialog' AND source_id=" + id
|
get() = "source_type='dialog' AND source_id=" + id
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class Chat(var id: Int, var name: String, var count: Int) : AbstractChat() {
|
inner class Chat(var id: Int, var name: String?, var count: Int?) : AbstractChat() {
|
||||||
|
|
||||||
override val query: String
|
override val query: String
|
||||||
get() = "source_type IN('group', 'supergroup', 'channel') AND source_id=" + id
|
get() = "source_type IN('group', 'supergroup', 'channel') AND source_id=" + id
|
||||||
|
@ -73,8 +73,8 @@ class HTMLExporter {
|
|||||||
|
|
||||||
var count_messages_chats = 0
|
var count_messages_chats = 0
|
||||||
var count_messages_dialogs = 0
|
var count_messages_dialogs = 0
|
||||||
for (c in chats) count_messages_chats += c.count
|
for (c in chats) count_messages_chats += c.count ?: 0
|
||||||
for (d in dialogs) count_messages_dialogs += d.count
|
for (d in dialogs) count_messages_dialogs += d.count ?: 0
|
||||||
|
|
||||||
scope.put("count.messages", count_messages_chats + count_messages_dialogs)
|
scope.put("count.messages", count_messages_chats + count_messages_dialogs)
|
||||||
scope.put("count.messages.chats", count_messages_chats)
|
scope.put("count.messages.chats", count_messages_chats)
|
||||||
|
Loading…
Reference in New Issue
Block a user