From f7d407d6bd6b5f4ea7781365cb548d9e4ea17b1b Mon Sep 17 00:00:00 2001 From: Edward Powell Date: Sat, 25 Oct 2014 12:13:49 -0400 Subject: [PATCH] [search] Don't record last seen url if feature not enabled Closes #644 --- willie/modules/search.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/willie/modules/search.py b/willie/modules/search.py index 49f68f6ef2..994ce13007 100644 --- a/willie/modules/search.py +++ b/willie/modules/search.py @@ -64,7 +64,8 @@ def g(bot, trigger): uri = google_search(query) if uri: bot.reply(uri) - bot.memory['last_seen_url'][trigger.sender] = uri + if 'last_seen_url' in bot.memory: + bot.memory['last_seen_url'][trigger.sender] = uri elif uri is False: bot.reply("Problem getting data from Google.") else: @@ -165,7 +166,8 @@ def duck(bot, trigger): if uri: bot.reply(uri) - bot.memory['last_seen_url'][trigger.sender] = uri + if 'last_seen_url' in bot.memory: + bot.memory['last_seen_url'][trigger.sender] = uri else: bot.reply("No results found for '%s'." % query)