Gracefully handle file documents without backend property.

This commit is contained in:
Sybren A. Stüvel 2016-07-26 17:20:17 +02:00
parent 83bad3d88d
commit a549934060

View File

@ -187,7 +187,7 @@ def update_file_name(node):
files_collection = current_app.data.driver.db['files']
file_doc = files_collection.find_one({'_id': ObjectId(file_id)})
if file_doc is None or file_doc['backend'] != 'gcs':
if file_doc is None or file_doc.get('backend') != 'gcs':
return
# For textures -- the map type should be part of the name.