[Bf-blender-cvs] [d2454487d1e] master: Fix: Incorrect custom property edit string to int change
Hans Goudey
noreply at git.blender.org
Mon Oct 11 03:54:07 CEST 2021
Commit: d2454487d1ee97caa270478aa0ef0bc8e5471ea1
Author: Hans Goudey
Date: Sun Oct 10 20:53:56 2021 -0500
Branches: master
https://developer.blender.org/rBd2454487d1ee97caa270478aa0ef0bc8e5471ea1
Fix: Incorrect custom property edit string to int change
This fixed an error in a corner case, and is a reasonable check anyway.
===================================================================
M release/scripts/startup/bl_operators/wm.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 1ce2beca509..17552b6e013 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1419,7 +1419,7 @@ class WM_OT_properties_edit(Operator):
# Helper method to avoid repetative code to retrieve a single value from sequences and non-sequences.
@staticmethod
def _convert_new_value_single(old_value, new_type):
- if hasattr(old_value, "__len__"):
+ if hasattr(old_value, "__len__") and len(old_value) > 0:
return new_type(old_value[0])
return new_type(old_value)
More information about the Bf-blender-cvs
mailing list