From: jprocter Date: Mon, 12 Oct 2009 12:45:03 +0000 (+0000) Subject: ensure id string doesn't get set to the empty string X-Git-Tag: Jalview_2_4_0b2~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8f3c4c6959620738f20d2d92f067f30fd9ac4593;p=jalview.git ensure id string doesn't get set to the empty string --- diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 87a965b..8585c4b 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -55,7 +55,7 @@ public class PDBfile extends jalview.io.AlignFile public void parse() throws IOException { // TODO set the filename sensibly - id = (inFile == null) ? "PDBFILE" : inFile.getName(); + id = (inFile == null || inFile.getName().length()==0) ? "PDBFILE" : inFile.getName(); try { chains = new Vector(); @@ -70,7 +70,12 @@ public class PDBfile extends jalview.io.AlignFile { if (line.indexOf("HEADER") == 0) { - id = line.substring(62, 67).trim(); + // make sure we don't get zero length ID strings + String tid = line.substring(62, 67).trim(); + if (tid.length()>0) + { + id = tid; + } continue; } // Were we to do anything with SEQRES - we start it here