JAL-3990 gradle spotlessApply
[jalview.git] / src / jalview / gui / structurechooser / TDBResultAnalyser.java
index 09ff0aa..2408d7a 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.gui.structurechooser;
 
 import java.util.Locale;
@@ -111,18 +131,22 @@ public class TDBResultAnalyser
     // ignore anything outside the sequence region
     for (FTSData row : collectedResults)
     {
-      int up_s = (Integer) row.getSummaryData()[idx_ups];
-      int up_e = (Integer) row.getSummaryData()[idx_upe];
-      String provider = (String) row.getSummaryData()[idx_mprov];
-      String mcat = (String) row.getSummaryData()[idx_mcat];
-      // this makes sure all new categories are in the score array.
-      int scorecat = scoreCategory(mcat);
-      if (sourceFilter == null || sourceFilter.equals(provider))
+      if (row.getSummaryData() != null
+              && row.getSummaryData()[idx_ups] != null)
       {
-        if (seq == row.getSummaryData()[0] && up_e > seq.getStart()
-                && up_s < seq.getEnd())
+        int up_s = (Integer) row.getSummaryData()[idx_ups];
+        int up_e = (Integer) row.getSummaryData()[idx_upe];
+        String provider = (String) row.getSummaryData()[idx_mprov];
+        String mcat = (String) row.getSummaryData()[idx_mcat];
+        // this makes sure all new categories are in the score array.
+        int scorecat = scoreCategory(mcat);
+        if (sourceFilter == null || sourceFilter.equals(provider))
         {
-          filteredResponse.add(row);
+          if (seq == row.getSummaryData()[0] && up_e > seq.getStart()
+                  && up_s < seq.getEnd())
+          {
+            filteredResponse.add(row);
+          }
         }
       }
     }