Collection.find_id(): Check if the result is false. If it is, return

None.  Otherwise, return result[0]
This commit is contained in:
Bryan Schumaker 2010-10-20 07:59:08 -04:00
parent b45117e761
commit 9caa247d04
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ class Collection:
def find_id(self, file):
stripped = file.strip(libsaria.path.sep)
split = stripped.split(libsaria.path.sep)
return self.fs_tree.walk_path(split)
res = self.fs_tree.walk_path(split)
if res == False:
return None
return res[0]
def get_attr(self, id, attr):
rec = self.records[id]