fixed exception caused by probably check for missing block

This commit is contained in:
Kevin Froman 2018-04-22 23:17:16 -05:00
parent 0dc6a0b6c5
commit 3e8d76e246

View File

@ -198,7 +198,10 @@ class API:
elif action == 'getData':
if self._utils.validateHash(data):
if not os.path.exists('data/blocks/' + data + '.db'):
resp = base64.b64encode(self._core.getData(data))
try:
resp = base64.b64encode(self._core.getData(data))
except TypeError:
resp = ""
if resp == False:
abort(404)
resp = ""