Pose library: fix asset creation operator poll when no object active #104466

Merged

1 Commits

Author SHA1 Message Date
39b130bc66 Pose library: fix asset creation operator poll when no object active
When the POSELIB_OT_create_pose_asset operator was displayed in the
UI, for instance pressing F3 after deleting an object, the poll method
tried to access the mode of a None object, leading to the following
error message being displayed:

```
Traceback (most recent call last):
  File ".../3.5/scripts/addons/pose_library/operators.py", line 63, in poll
    if context.object.mode != "POSE":
AttributeError: 'NoneType' object has no attribute 'mode'
```

This commit adds a check for whether an object is currently active.
2023-03-07 17:29:03 +01:00