From a5499340608b4215c6a125aadc78652148f17490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 26 Jul 2016 17:20:17 +0200 Subject: [PATCH] Gracefully handle file documents without backend property. --- pillar/application/utils/gcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/application/utils/gcs.py b/pillar/application/utils/gcs.py index c43687bd..54452429 100644 --- a/pillar/application/utils/gcs.py +++ b/pillar/application/utils/gcs.py @@ -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.