diff --git a/animation_animall.py b/animation_animall.py
index a8b1ae2e085180cfe2f56793e40b3917cc55ad07..a085a2e16a612563a544d76a608f6cfd90e7a46b 100644
--- a/animation_animall.py
+++ b/animation_animall.py
@@ -88,7 +88,7 @@ class VIEW3D_PT_animall(bpy.types.Panel):
     # show this addon only in the Camera-Data-Panel
     @classmethod
     def poll(self, context):
-        if context.active_object.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'}:
+        if context.active_object and context.active_object.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE'}:
             return context.active_object.type
     
     # draw the gui