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 'archipack/archipack_progressbar.py')
-rw-r--r--archipack/archipack_progressbar.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/archipack/archipack_progressbar.py b/archipack/archipack_progressbar.py
index 16740c99..35ed166d 100644
--- a/archipack/archipack_progressbar.py
+++ b/archipack/archipack_progressbar.py
@@ -36,13 +36,16 @@ info_header_draw = None
def update(self, context):
global last_update
- areas = context.window.screen.areas
- for area in areas:
- if area.type == 'INFO':
- area.tag_redraw()
- if time() - last_update > 0.1:
- bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
- last_update = time()
+ if (context.window is not None and
+ context.window.screen is not None and
+ context.window.screen.areas is not None):
+ areas = context.window.screen.areas
+ for area in areas:
+ if area.type == 'INFO':
+ area.tag_redraw()
+ if time() - last_update > 0.1:
+ bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
+ last_update = time()
def register():