From 8f3c4c6959620738f20d2d92f067f30fd9ac4593 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 12 Oct 2009 12:45:03 +0000 Subject: [PATCH] ensure id string doesn't get set to the empty string --- src/MCview/PDBfile.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 1.7.10.2