Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'blenderkit/search.py')
-rw-r--r--blenderkit/search.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py
index 49337888..7c02be5a 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -629,12 +629,13 @@ class ThumbDownloader(threading.Thread):
def run(self):
# print('thumb downloader', self.url)
+ r = None
try:
r = requests.get(self.url, stream=False)
except Exception as e:
bk_logger.error('Thumbnail download failed')
bk_logger.error(str(e))
- if r.status_code == 200:
+ if r and r.status_code == 200:
with open(self.path, 'wb') as f:
f.write(r.content)
# ORIGINALLY WE DOWNLOADED THUMBNAILS AS STREAM, BUT THIS WAS TOO SLOW.