coyote240/manadex

Runtime error on empty db

Closed this issue · 1 comments

In indexhandler.py getting an error:
HTTPServerRequest(protocol='http', host='shaycraft.cloudapp.net:8888', method='GET', uri='/', version='HTTP/1.1', remote_ip='71.237.26.217', headers={'Accept-Language': 'en-US,en;q=0.8,es;q=0.6', 'Accept-Encoding': 'gzip, deflate, sdch', 'Host': 'shaycraft.cloudapp.net:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36', 'Connection': 'keep-alive', 'Cookie': '_ga=GA1.3.324779738.1435299035', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1'})
Traceback (most recent call last):
File "/home/shaycraft/src/github-shaycraft/manadex/manadex/lib/python2.7/site-packages/tornado/web.py", line 1445, in _execute
result = yield result
File "/home/shaycraft/src/github-shaycraft/manadex/manadex/lib/python2.7/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
File "/home/shaycraft/src/github-shaycraft/manadex/manadex/lib/python2.7/site-packages/tornado/concurrent.py", line 232, in result
raise_exc_info(self._exc_info)
File "/home/shaycraft/src/github-shaycraft/manadex/manadex/lib/python2.7/site-packages/tornado/gen.py", line 1017, in run
yielded = self.gen.send(value)
File "/home/shaycraft/src/github-shaycraft/manadex/app/handlers/indexhandler.py", line 20, in get
{'_id': {'$in': card_refs.get('collection')}},
AttributeError: 'NoneType' object has no attribute 'get'
[E 160210 06:16:13 web:1946] 500 GET / (71.237.26.217) 4.14ms

Fixed with #6