Add Curve Extra Objects: Fix invalid context traceback error

This patch simply adds a preliminary check for the built-in Add Curve Extra Objects add-on.
The check basically prevents a traceback in the console.
Without this patch the add-on still functions as intended, just with a console prompt.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D9666
This commit is contained in:
Ethan Simon 2021-06-08 18:00:37 -04:00 committed by Aaron Carlisle
parent 448eeb681a
commit 3a409083e7
1 changed files with 5 additions and 4 deletions

View File

@ -424,10 +424,11 @@ def menu_funcs(self, context):
layout = self.layout
if bpy.context.view_layer.objects.active.type == "CURVE":
layout.operator("curve.bevelcurve")
layout.operator("curve.tapercurve")
layout.separator()
if context.view_layer.objects.active:
if context.view_layer.objects.active.type == "CURVE":
layout.operator("curve.bevelcurve")
layout.operator("curve.tapercurve")
layout.separator()
# Register
classes = [