Permalink
Browse files

fixing possible exception when reading SCF files

occurs when reading SCF files without comments or private data

Signed-off-by: Hannes Brandstätter-Müller <hannes.mueller@gmail.com>
  • Loading branch information...
1 parent aa4aa0b commit 4a95213970c3974cd1046d97aacad325ea5636f4 @brandstaetter brandstaetter committed Apr 19, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 sequencing/src/main/java/org/biojava/bio/program/scf/SCF.java
@@ -361,8 +361,12 @@ public void parse() throws IOException,
TreeMap sectionOrder = new TreeMap();
sectionOrder.put(new Long(header.samples_offset), SAMPLES);
sectionOrder.put(new Long(header.bases_offset), BASES);
- sectionOrder.put(new Long(header.comments_offset), COMMENTS);
- sectionOrder.put(new Long(header.private_offset), PRIVATE);
+ if (header.comments_size > 0) {
+ sectionOrder.put(new Long(header.comments_offset), COMMENTS);
+ }
+ if (header.private_size > 0) {
+ sectionOrder.put(new Long(header.private_offset), PRIVATE);
+ }
for (Iterator it = sectionOrder.keySet().iterator() ;
it.hasNext() ;) {

0 comments on commit 4a95213

Please sign in to comment.