Skip to content

Commit

Permalink
Reject piped input (/dev/stdin) for BedToIntervalList
Browse files Browse the repository at this point in the history
  • Loading branch information
kockan committed Nov 14, 2023
1 parent 5721517 commit a62843d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/picard/util/BedToIntervalList.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import picard.cmdline.CommandLineProgram;
import picard.cmdline.StandardOptionDefinitions;
import picard.cmdline.programgroups.IntervalsManipulationProgramGroup;
import picard.nio.PicardHtsPath;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -116,6 +117,11 @@ protected int doWork() {
IOUtil.assertFileIsReadable(INPUT);
IOUtil.assertFileIsReadable(SEQUENCE_DICTIONARY);
IOUtil.assertFileIsWritable(OUTPUT);

if(PicardHtsPath.isOther(new PicardHtsPath(INPUT))) {
throw new IllegalArgumentException("BedToIntervalList cannot read from /dev/stdin.");
}

try {
// create a new header that we will assign the dictionary provided by the SAMSequenceDictionaryExtractor to.
final SAMFileHeader header = new SAMFileHeader();
Expand Down

0 comments on commit a62843d

Please sign in to comment.