From ad3755403473df3d3baeb0fe97cc623b41705a62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vil=C3=A9m=20Duha?= <vilda.novak@gmail.com>
Date: Mon, 15 Feb 2021 14:34:13 +0100
Subject: [PATCH] BlenderKit: fix upload reporting when packing fails

Now sends a clear message to the UI and cancels upload
also fixes a small bug in update_down_up
---
 blenderkit/__init__.py | 2 +-
 blenderkit/upload.py   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py
index d7591d665..868bdfadc 100644
--- a/blenderkit/__init__.py
+++ b/blenderkit/__init__.py
@@ -254,7 +254,7 @@ def udate_down_up(self, context):
     s = context.scene
     wm = bpy.context.window_manager
     props = s.blenderkitUI
-    if wm['search results'] == None and props.down_up == 'SEARCH':
+    if wm.get('search results') == None and props.down_up == 'SEARCH':
         search.search()
 
 def switch_search_results(self, context):
diff --git a/blenderkit/upload.py b/blenderkit/upload.py
index 49533e99b..110994e38 100644
--- a/blenderkit/upload.py
+++ b/blenderkit/upload.py
@@ -986,6 +986,10 @@ class Uploader(threading.Thread):
                     "file_path": fpath
                 })
 
+                if not os.path.exists(fpath):
+                    self.send_message ("File packing failed, please try manual packing first")
+                    return {'CANCELLED'}
+
             self.send_message('Uploading files')
 
             uploaded = upload_bg.upload_files(self.upload_data, files)
-- 
GitLab