Merge pull request #265 from ybenjo/fix-search-result-size-bug
[rainbowstream.git] / rainbowstream / rainbow.py
index a7007cc..33c0d52 100644 (file)
@@ -476,7 +476,7 @@ def search():
     # Return results
     if rel:
         printNicely('Newest tweets:')
-        for i in reversed(xrange(count)):
+        for i in reversed(xrange(min(len(rel), count))):
             draw(t=rel[i], keyword=query)
         printNicely('')
     else: