fix: catch runtime error

feat: enable build for undo branch
This commit is contained in:
Swann
2020-12-23 17:57:36 +01:00
parent cd1e535a56
commit 2f4e30f432
2 changed files with 8 additions and 3 deletions

View File

@ -10,4 +10,5 @@ build:
only:
refs:
- master
- develop
- develop
- 132-fix-undo-edit-last-operation-redo-handling-2

View File

@ -147,8 +147,12 @@ class BlDatablock(ReplicatedDatablock):
name = self.data.get('name')
logging.debug(f"Constructing {name}")
datablock_ref = self._construct(data=self.data)
for i in range(bpy.context.preferences.edit.undo_steps+1):
bpy.ops.ed.undo_push(message="Multiuser history flush")
try:
for i in range(bpy.context.preferences.edit.undo_steps+1):
bpy.ops.ed.undo_push(message="Multiuser history flush")
except RuntimeError:
logging.error("Fail to overwrite history")
if datablock_ref is not None:
setattr(datablock_ref, 'uuid', self.uuid)