Checks for derivative existence prior to adding
@@ -187,6 +187,7 @@ class BIDSLayout(Layout):
for p in paths:
p = os.path.abspath(p)
+ if os.path.exists(p):
if check_for_description(p):
deriv_dirs.append(p)
else:
@@ -194,7 +195,7 @@ class BIDSLayout(Layout):
if os.path.isdir(os.path.join(p, d))]
for sd in subdirs:
sd = os.path.join(p, sd)
- if check_for_description(srd):
+ if check_for_description(sd):
deriv_dirs.append(sd)
for deriv in deriv_dirs:
