Collection.find_id(): Check if the result is false. If it is, return
None. Otherwise, return result[0]
This commit is contained in:
parent
b45117e761
commit
9caa247d04
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue