Fix: Incorrect custom property edit string to int change

This fixed an error in a corner case, and is a reasonable check anyway.
This commit is contained in:
Hans Goudey 2021-10-10 20:53:56 -05:00
parent 1bfa9539d3
commit d2454487d1
1 changed files with 1 additions and 1 deletions

View File

@ -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)