JAL-3829 avoid sending rubbish to PDBe search api
authorJim Procter <j.procter@dundee.ac.uk>
Tue, 14 Sep 2021 11:36:01 +0000 (12:36 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Tue, 14 Sep 2021 11:36:01 +0000 (12:36 +0100)
src/jalview/gui/structurechooser/ThreeDBStructureChooserQuerySource.java

index d465e23..78dca3f 100644 (file)
@@ -440,7 +440,10 @@ public class ThreeDBStructureChooserQuerySource
   {
 
     String pdb_Query = buildPDBFTSQueryFor(upResponse);
-
+    if (pdb_Query.length()==0)
+    {
+      return null;
+    }
     FTSRestResponse resultList;
     FTSRestRequest pdbRequest = new FTSRestRequest();
     pdbRequest.setAllowEmptySeq(false);
@@ -450,6 +453,7 @@ public class ThreeDBStructureChooserQuerySource
     pdbRequest.setWantedFields(
             pdbquery.getDocFieldPrefs().getStructureSummaryFields());
     pdbRequest.setSearchTerm(pdb_Query + ")");
+    
     resultList = pdbquery.executePDBFTSRestRequest(pdbRequest);
 
     lastPdbRequest = pdbRequest;