Fix console errors from UI when no object is selected #1

Closed
Andrej wants to merge 1 commits from Andrej730:fix-ui-console-error into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 0cbabdf69e - Show all commits

View File

@ -466,7 +466,7 @@ def curve_tools_context_menu(self, context):
def curve_tools_object_context_menu(self, context):
bl_label = 'Curve tools'
if context.active_object.type == "CURVE":
if (obj := context.active_object) and obj.type == "CURVE":
self.layout.operator("curvetools.scale_reset", text="Scale Reset")
self.layout.operator("curvetools.add_toolpath_offset_curve", text="Offset Curve")
self.layout.operator("curvetools.remove_doubles", text='Remove Doubles')