[Bf-extensions-cvs] [e9b2f45e] master: BlenderKit: fix division by zero in case results are there but have zero length because of possible fitlering inside addon

Vilém Duha noreply at git.blender.org
Mon Aug 12 16:05:29 CEST 2019


Commit: e9b2f45eb2a4936a9a7cc6fe2ac3db508fd83b21
Author: Vilém Duha
Date:   Sun Aug 11 08:42:14 2019 +0200
Branches: master
https://developer.blender.org/rBAe9b2f45eb2a4936a9a7cc6fe2ac3db508fd83b21

BlenderKit: fix division by zero in case results are there but have zero length because of possible fitlering inside addon

===================================================================

M	blenderkit/ui.py

===================================================================

diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index e62b8aa6..f88c4f31 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -1128,7 +1128,7 @@ def update_ui_size(area, region):
         (ui.bar_width - 2 * ui.drawoffset) / (ui.thumb_size + ui.margin))
 
     search_results = bpy.context.scene.get('search results')
-    if search_results != None:
+    if search_results != None and ui.wcount>0:
         ui.hcount = min(user_preferences.max_assetbar_rows, math.ceil(len(search_results) / ui.wcount))
     else:
         ui.hcount = 1



More information about the Bf-extensions-cvs mailing list