From 3e8d76e2461bd736dd85ac65177fa61eec372094 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 22 Apr 2018 23:17:16 -0500 Subject: [PATCH] fixed exception caused by probably check for missing block --- onionr/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/onionr/api.py b/onionr/api.py index 9acdf0e2..b68326d0 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -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 = ""