fix: [showpaste] fix: #346, avoid None screenshots

pull/350/head
Terrtia 2019-05-06 10:00:39 +02:00
parent 97fa1ddca4
commit cc61c99290
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ def get_item_screenshot_path(item):
screenshot = r_serv_metadata.hget('paste_metadata:{}'.format(item), 'screenshot') screenshot = r_serv_metadata.hget('paste_metadata:{}'.format(item), 'screenshot')
if screenshot: if screenshot:
screenshot = os.path.join(screenshot[0:2], screenshot[2:4], screenshot[4:6], screenshot[6:8], screenshot[8:10], screenshot[10:12], screenshot[12:]) screenshot = os.path.join(screenshot[0:2], screenshot[2:4], screenshot[4:6], screenshot[6:8], screenshot[8:10], screenshot[10:12], screenshot[12:])
else:
screenshot = ''
return screenshot return screenshot
def showpaste(content_range, requested_path): def showpaste(content_range, requested_path):