diff --git a/matrix_appservice_kakaotalk/matrix.py b/matrix_appservice_kakaotalk/matrix.py index 1930502..dc8a80b 100644 --- a/matrix_appservice_kakaotalk/matrix.py +++ b/matrix_appservice_kakaotalk/matrix.py @@ -157,7 +157,8 @@ class MatrixHandler(BaseMatrixHandler): if not user.is_connected: return message = await DBMessage.get_by_mxid(event_id, portal.mxid) - await user.client.mark_read(portal.channel_props, message.ktid) + if message: + await user.client.mark_read(portal.channel_props, message.ktid) async def handle_ephemeral_event( self, evt: ReceiptEvent | Event