diff --git a/space_view3d_math_vis/utils.py b/space_view3d_math_vis/utils.py index 28ceb554b..526c563b5 100644 --- a/space_view3d_math_vis/utils.py +++ b/space_view3d_math_vis/utils.py @@ -155,6 +155,13 @@ def console_math_data(): if not disp: continue + # In case `var` is a RNA struct 'proxy', check if the underlying RNA data is still valid. + # It can become invalid due to Blender data being freed or re-allocated e.g. + try: + hasattr(var, "bl_rna") + except ReferenceError: + continue + if isinstance(var, Matrix): if len(var.col) != 4 or len(var.row) != 4: if len(var.col) == len(var.row):