]> git.openstreetmap.org Git - osqa.git/commitdiff
undoing the changes made in commit #1045, could cause null pointer exceptions
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 23 May 2011 12:45:12 +0000 (12:45 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 23 May 2011 12:45:12 +0000 (12:45 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1046 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/modules/ui.py

index 114885b6999f56e59110777cd1bb03e62ff6f14f..26941104d8a35d61198dc202b4dfc0de5ed58cf4 100644 (file)
@@ -11,19 +11,13 @@ class Registry(list):
 
     def find_by_name(self, name):
         for i in self:
 
     def find_by_name(self, name):
         for i in self:
-            try:
-                if i.name and (i.name == name):
-                    return i
-            except AttributeError:
-                pass
+            if i.name and (i.name == name):
+                return i
 
     def remove_by_name(self, name):
         for i, r in enumerate(self):
 
     def remove_by_name(self, name):
         for i, r in enumerate(self):
-            try:
-                if r.name and (r.name == name):
-                    return self.pop(i)
-            except AttributeError:
-                pass
+            if r.name and (r.name == name):
+                return self.pop(i)
 
 
 HEAD_CONTENT = 'HEAD_CONTENT'
 
 
 HEAD_CONTENT = 'HEAD_CONTENT'