From 4eb5bb894267bb37adf5b92e6c28dce2908e73bd Mon Sep 17 00:00:00 2001 From: "Sean B. Palmer" Date: Thu, 20 Nov 2008 10:25:03 +0000 Subject: [PATCH] Fixed a minor search bug. --- modules/search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/search.py b/modules/search.py index 4fcaabc..8523832 100755 --- a/modules/search.py +++ b/modules/search.py @@ -37,7 +37,9 @@ def result(query): def count(query): results = search(query) - if not results['responseData'] or not results['responseData']['cursor']: + if not results.has_key('responseData'): return '0' + if not results['responseData'].has_key('cursor'): return '0' + if not results['responseData']['cursor'].has_key('estimatedResultCount'): return '0' return results['responseData']['cursor']['estimatedResultCount']