From 2580c2b6fa0ce8c711f4b13f6ffc07ec862dcf2f Mon Sep 17 00:00:00 2001
From: Jason van Gumster <jason@handturkeystudios.com>
Date: Mon, 1 Jul 2013 21:00:28 +0000
Subject: [PATCH] Fix for corner case where there are no objects in the scene.

---
 object_edit_linked.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/object_edit_linked.py b/object_edit_linked.py
index cacac6124..3fb66bebc 100644
--- a/object_edit_linked.py
+++ b/object_edit_linked.py
@@ -74,7 +74,7 @@ class EditLinked(bpy.types.Operator):
 
     @classmethod
     def poll(cls, context):
-        return settings["original_file"] == "" and (
+        return settings["original_file"] == "" and context.active_object is not None and (
                 (context.active_object.dupli_group and
                  context.active_object.dupli_group.library is not None) or
                  context.active_object.library is not None)
@@ -155,6 +155,10 @@ class PanelLinkedEdit(bpy.types.Panel):
     bl_space_type = "VIEW_3D"
     bl_region_type = "TOOLS"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.active_object is not None) or (settings["original_file"] != "")
+
     def draw(self, context):
         layout = self.layout
         scene = context.scene
-- 
GitLab