From ecb362848dce12a35f5b9ef6f0582f8c877490e9 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 29 Dec 2010 22:15:47 +0000 Subject: [PATCH] Fix error when attempting to match a nonexistent tag svn: r16322 --- src/Filters/Rules/_HasTagBase.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Filters/Rules/_HasTagBase.py b/src/Filters/Rules/_HasTagBase.py index afac97f9a..18ed9e569 100644 --- a/src/Filters/Rules/_HasTagBase.py +++ b/src/Filters/Rules/_HasTagBase.py @@ -55,13 +55,15 @@ class HasTagBase(Rule): """ Prepare the rule. Things we want to do just once. """ + self.tag_handle = None tag = db.get_tag_from_name(self.list[0]) - self.tag_handle = tag.get_handle() + if tag is not None: + self.tag_handle = tag.get_handle() def apply(self, db, obj): """ Apply the rule. Return True for a match. """ - if not self.list[0]: + if self.tag_handle is None: return False return self.tag_handle in obj.get_tag_list()