summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfbin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/fbin.py b/fbin.py
index 1d70712..e6a2b3f 100755
--- a/fbin.py
+++ b/fbin.py
@@ -204,8 +204,8 @@ class Application(object):
if '.' in hash:
hash = hash.split('.')[0]
file = self.get_file(hash, True)
- filename = file.get_path()
- if filename == None:
+ filename = file.get_path() if file else None
+ if file == None or filename == None:
start_response('404 Not Found', [('Content-Type', 'text/html')])
return ['<h1>Not Found</h1><p>The file you requested does not exist.</p>']