diff --git a/bids/layout/layout.py b/bids/layout/layout.py index 38aa62906..855222728 100644 --- a/bids/layout/layout.py +++ b/bids/layout/layout.py @@ -678,7 +678,9 @@ def get(self, return_type='object', target=None, scope='all', results = [x for x in results if target in x.entities] if return_type == 'id': - results = list(set([x.entities[target] for x in results])) + results = list(set( + [x.entities[target] for x in results + if type(x.entities[target]) is not dict])) results = natural_sort(results) elif return_type == 'dir':