From 045f7f5643539b21f6f46ee1ce2daee76f74a954 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 10 Jan 2018 10:46:43 +0100 Subject: [PATCH] Assert hash is not None when migrating from JSON sessions --- telethon/tl/session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/tl/session.py b/telethon/tl/session.py index 636d512d..34427314 100644 --- a/telethon/tl/session.py +++ b/telethon/tl/session.py @@ -163,7 +163,8 @@ class Session: rows = [] for p_id, p_hash in data.get('entities', []): - rows.append((p_id, p_hash, None, None, None)) + if p_hash is not None: + rows.append((p_id, p_hash, None, None, None)) return rows except UnicodeDecodeError: return [] # No entities