From 78b5f057290f4c033a38ed238a3dc0cb6ef68dce Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 1 May 2019 23:50:23 +0200 Subject: [PATCH] Fix `search` when the result is empty Return an empty result instead of raising --- fbchat/_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fbchat/_client.py b/fbchat/_client.py index 59bad02..69358bd 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -828,6 +828,9 @@ class Client(object): ) result = j["payload"]["search_snippets"][query] + if not result: + return {} + if fetch_messages: search_method = self.searchForMessages else: