Skip to content

Commit

Permalink
Merge pull request #473 from nbeliy/nb_470
Browse files Browse the repository at this point in the history
[FIX] cleaner handling of missing dependency
  • Loading branch information
Remi-Gau authored Nov 11, 2022
2 parents df2aa00 + 8452eb7 commit 97a29a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions +bids/layout.m
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,13 @@
continue
end
info_dest = bids.internal.return_file_info(BIDS, dest);
try
BIDS.subjects(info_dest.sub_idx).(info_dest.modality)(info_dest.file_idx) ...
.dependencies.explicit{end + 1, 1} = file_list{iFile};
catch ME
warning('This may fail if your dataset is not valid.');
rethrow(ME);
if isempty(info_dest.file_idx)
msg = ['IntendedFor file ' dest ' from ' file.filename ' not indexed'];
bids.internal.error_handling(mfilename, 'IntendedForMissing', msg, tolerant, verbose);
continue
end
BIDS.subjects(info_dest.sub_idx).(info_dest.modality)(info_dest.file_idx) ...
.dependencies.explicit{end + 1, 1} = file_list{iFile};
end

end
Expand Down

0 comments on commit 97a29a9

Please sign in to comment.